*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #222;
  --text: #e5e5e5;
  --text-dim: #888;
  --accent: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.3);
  --gradient: linear-gradient(135deg, #f97316, #ef4444);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* LANDING */
#landing, #results, #calculating {
  display: none;
  width: 100%;
}
#landing.visible, #results.visible, #calculating.visible {
  display: block;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* LANDING PAGE */
.landing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-emoji {
  -webkit-text-fill-color: initial;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-dim);
  margin-bottom: 48px;
  font-weight: 400;
}

.input-group {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 500px;
}

#job-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
#job-input:focus { border-color: var(--accent); }
#job-input.shake { animation: shake 0.4s ease; }

.input-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
  opacity: 0.7;
}

#check-btn {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
#check-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}
#check-btn:active { transform: translateY(0); }

/* CALCULATING */
.calc-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}

#calc-text {
  font-size: 1.2rem;
  color: var(--text-dim);
}

/* RESULTS */
.results-inner {
  padding: 60px 0 40px;
}

#result-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.cooked-label {
  display: block;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 6px 16px;
  border-radius: 999px;
  width: fit-content;
  margin: 0 auto 40px;
}
.level-raw { background: rgba(34,197,94,0.15); color: #22c55e; }
.level-warming { background: rgba(234,179,8,0.15); color: #eab308; }
.level-medium { background: rgba(249,115,22,0.15); color: #f97316; }
.level-welldone { background: rgba(239,68,68,0.15); color: #ef4444; }
.level-burnt { background: rgba(239,68,68,0.25); color: #ff3333; text-shadow: 0 0 12px rgba(255,50,50,0.5); }

/* COUNTDOWN */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 4vw, 32px);
  margin-bottom: 48px;
}
.cd-unit {
  text-align: center;
}
.cd-num {
  font-size: clamp(2.5rem, 10vw, 5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.cd-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 8px;
}

/* CONFIDENCE */
.confidence-section {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 40px;
  justify-content: center;
  flex-wrap: wrap;
}

.confidence-ring-wrap {
  position: relative;
  width: 120px; height: 120px;
  flex-shrink: 0;
}
.confidence-ring-wrap svg { transform: rotate(-90deg); }
.confidence-ring-wrap circle {
  fill: none;
  stroke-width: 8;
}
.ring-bg { stroke: var(--border); }
#confidence-ring {
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#confidence-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
}

.confidence-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 240px;
}

/* DESCRIPTION */
#result-description {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 48px;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* TIMELINE */
.timeline-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 24px;
}

#timeline {
  position: relative;
  max-width: 500px;
  margin: 0 auto 48px;
  padding-left: 24px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  padding: 0 0 28px 24px;
  position: relative;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -29px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.timeline-year {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.timeline-event {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ACTIONS */
.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  margin-bottom: 24px;
}

.btn-share, .btn-secondary {
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-share {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-share:hover { border-color: var(--accent); }
.btn-secondary {
  background: var(--gradient);
  color: #fff;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

/* FOOTER */
footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 2;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ANIMATIONS */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 500px) {
  .input-group {
    flex-direction: column;
  }
  #check-btn { width: 100%; }
  .confidence-section { flex-direction: column; text-align: center; }
  .confidence-label { max-width: 100%; }
  .quick-search-row { flex-direction: column; }
  .quick-search-row button { width: 100%; }
}

/* QUICK SEARCH ON RESULTS PAGE */
.quick-search {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.quick-search-row {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
}
#quick-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
#quick-input:focus {
  border-color: var(--accent);
}
#quick-input::placeholder {
  color: rgba(255,255,255,0.35);
}
#quick-btn {
  padding: 0.75rem 1.5rem;
  white-space: nowrap;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
#quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(249,115,22,0.3);
}
#quick-btn:active { transform: translateY(0); }
