/* =========================================================
   Coding Journey — Adeeb Irfaan
   Stylesheet

   Contents:
   1. Design tokens (colours, sizes)
   2. Base / reset
   3. Background decoration
   4. Reusable pieces (container, buttons, cards, headings)
   5. Navigation bar
   6. Hero + code editor visual
   7. About cards
   8. Skill pills
   9. Roadmap timeline
   10. Project card + phone mockup
   11. Footer
   12. Scroll reveal animation
   13. Responsive (phone) tweaks
   14. Reduced motion
   ========================================================= */


/* ---------------------------------------------------------
   1. DESIGN TOKENS
   "Custom properties" (variables) let us reuse values.
   Change a colour here and it changes everywhere.
   --------------------------------------------------------- */
:root {
  --bg: #05070f;               /* near-black navy */
  --bg-soft: #0a0f1f;
  --surface: rgba(15, 22, 42, 0.55);  /* see-through card colour */
  --border: rgba(148, 180, 255, 0.12);
  --border-strong: rgba(34, 211, 238, 0.45);

  --text: #e6edf7;
  --muted: #8b97ad;

  --cyan: #22d3ee;
  --blue: #3b82f6;
  --purple: #8b5cf6;

  --glow: 0 0 24px rgba(34, 211, 238, 0.25);
  --radius: 16px;
  --max-width: 1120px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SF Mono", monospace;
}


/* ---------------------------------------------------------
   2. BASE / RESET
   --------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;   /* width includes padding + border */
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;  /* smooth scrolling for #links */
  scroll-padding-top: 80px; /* stop sticky navbar covering headings */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;       /* no sideways scrolling on phones */
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* Buttons don't inherit fonts by default — make them match the page */
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Hidden on screen, but still read out by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Visible outline for keyboard users */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}


/* ---------------------------------------------------------
   3. BACKGROUND DECORATION
   position: fixed keeps it behind everything while scrolling.
   --------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;                 /* top/right/bottom/left = 0 */
  z-index: -1;              /* sit behind the page content */
  overflow: hidden;
  pointer-events: none;     /* clicks pass straight through */
}

/* A soft grid made from two repeating gradients (lines) */
.bg-grid {
  position: absolute;
  inset: -60px 0 0 0;
  background-image:
    linear-gradient(rgba(148, 180, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 180, 255, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  /* fade the grid out towards the bottom */
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
  animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
  to { transform: translateY(60px); } /* moves exactly one cell = seamless loop */
}

/* Tiny stars: many small radial gradients repeated across the screen */
.bg-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 200px 160px, var(--cyan), transparent),
    radial-gradient(1px 1px at 300px 40px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 360px 220px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 80px 260px, rgba(139, 92, 246, 0.9), transparent);
  background-size: 400px 300px;
  opacity: 0.5;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.25; }
  to   { opacity: 0.6; }
}

/* Big blurry coloured circles that slowly float */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: float-blob 18s ease-in-out infinite alternate;
}

.blob-cyan   { width: 420px; height: 420px; background: var(--cyan);   top: -120px; left: -100px; }
.blob-blue   { width: 380px; height: 380px; background: var(--blue);   top: 30%;    right: -140px; animation-delay: -6s; }
.blob-purple { width: 360px; height: 360px; background: var(--purple); bottom: -120px; left: 30%; animation-delay: -12s; opacity: 0.25; }

@keyframes float-blob {
  to { transform: translate(60px, 40px) scale(1.1); }
}


/* ---------------------------------------------------------
   4. REUSABLE PIECES
   --------------------------------------------------------- */

/* Centers content and limits its width */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 24px;
}

.section-head {
  margin-bottom: 40px;
}

/* Small uppercase label above headings */
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem); /* min, preferred, max */
}

.section-sub {
  color: var(--muted);
  margin-top: 8px;
}

/* Text filled with a gradient */
.gradient-text {
  background: linear-gradient(90deg, var(--cyan), var(--blue) 60%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Glassy card used in several sections */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);          /* frosted glass effect */
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;   /* fully rounded */
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  color: #04101a;
  box-shadow: 0 0 0 rgba(34, 211, 238, 0);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.45);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: rgba(34, 211, 238, 0.06);
}


/* ---------------------------------------------------------
   5. NAVIGATION BAR
   position: sticky keeps it at the top while scrolling.
   --------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 7, 15, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;                    /* put items in a row */
  align-items: center;
  justify-content: space-between;   /* logo left, links right */
  height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.logo-dot {
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {           /* "active" is added by script.js */
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  transition: box-shadow 0.2s ease;
}

/* The badge is a link now, so keep it cyan (not grey like other links) */
.nav-links .badge {
  color: var(--cyan);
}

.nav-links .badge:hover {
  box-shadow: var(--glow);
}

/* Little blinking "live" dot */
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}


/* ---------------------------------------------------------
   6. HERO
   CSS Grid puts text and visual side by side.
   --------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;   /* two columns */
  align-items: center;
  gap: 56px;
  min-height: calc(100vh - 64px);
  padding-top: 64px;
  padding-bottom: 64px;
}

.hero .eyebrow {
  padding: 6px 14px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.06);
  box-shadow: var(--glow);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin: 12px 0 20px;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 34rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* --- Code editor card --- */
.hero-visual {
  position: relative;
  padding: 32px 0;
}

.editor {
  position: relative;
  background: rgba(10, 15, 31, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 0 50px rgba(34, 211, 238, 0.12);
  overflow: hidden;
  animation: hover-float 6s ease-in-out infinite;
}

@keyframes hover-float {
  50% { transform: translateY(-12px); }
}

.editor-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.editor-file {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.editor-code {
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--text);
  overflow-x: auto;
}

/* Colours for the fake syntax highlighting */
.c-num     { display: inline-block; width: 2em; color: #3c4760; user-select: none; }
.c-key     { color: var(--purple); }
.c-var     { color: var(--cyan); }
.c-fn      { color: var(--blue); }
.c-str     { color: #7ee2a8; }
.c-num-lit { color: #f9a86b; }
.c-com     { color: #56627a; font-style: italic; }

/* Blinking text cursor */
.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--cyan);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.editor-status {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #28c840;
}

/* Floating tech tags around the editor */
.float-tag {
  position: absolute;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  border-radius: 999px;
  background: rgba(10, 15, 31, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--cyan);
  box-shadow: var(--glow);
  animation: hover-float 7s ease-in-out infinite;
}

.tag-1 { top: 0;      right: 8%;  }
.tag-2 { top: 42%;    left: -24px; animation-delay: -2s; color: #c4b5fd; border-color: rgba(139, 92, 246, 0.45); }
.tag-3 { bottom: 0;   left: 14%;  animation-delay: -4s; }
.tag-4 { bottom: 18%; right: -16px; animation-delay: -1s; color: #93c5fd; border-color: rgba(59, 130, 246, 0.45); }


/* ---------------------------------------------------------
   7. ABOUT CARDS
   auto-fit + minmax = as many columns as fit, each ≥ 230px.
   --------------------------------------------------------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.info-card {
  padding: 28px;
}

.icon {
  display: grid;
  place-items: center;   /* center the svg */
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.info-value {
  font-weight: 600;
}


/* ---------------------------------------------------------
   8. SKILL PILLS
   flex-wrap lets pills flow onto new lines.
   --------------------------------------------------------- */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.95rem;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pill:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  color: var(--cyan);
  box-shadow: var(--glow);
}

/* Core focus skills: brighter border, gradient, glow */
.pill-core {
  font-weight: 700;
  color: #fff;
  border-color: rgba(34, 211, 238, 0.6);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.18));
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.3);
}

.star {
  color: var(--cyan);
  margin-right: 6px;
}


/* ---------------------------------------------------------
   9. ROADMAP TIMELINE
   A vertical line (::before) with numbered circles on it.
   --------------------------------------------------------- */
.timeline {
  position: relative;
  max-width: 760px;
}

/* The vertical line */
.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 27px;
  width: 2px;
  background: linear-gradient(var(--cyan), var(--blue), var(--purple), transparent);
  opacity: 0.5;
}

.step {
  position: relative;
  display: flex;
  gap: 24px;
  padding-bottom: 28px;
}

.step-num {
  flex-shrink: 0;   /* don't let the circle get squished */
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--cyan);
  background: var(--bg-soft);
  border: 1px solid rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.3), inset 0 0 12px rgba(34, 211, 238, 0.15);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.step-body {
  flex: 1;
  min-width: 0;   /* lets long text wrap instead of overflowing */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.step-body h3 {
  font-size: 1.08rem;
  margin-bottom: 4px;
}

.step-body p {
  color: var(--muted);
  font-size: 0.94rem;
}

/* Hovering anywhere on a step highlights both parts */
.step:hover .step-num {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.6), inset 0 0 12px rgba(34, 211, 238, 0.25);
}

/* (No sliding on hover any more: a moving target is hard to tick.) */
.step:hover .step-body {
  border-color: var(--border-strong);
  box-shadow: var(--glow);
}

/* --- Expandable phase header (<summary>) --- */
.step-summary {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 22px;
  list-style: none;          /* hide the default ▶ triangle */
  cursor: pointer;
  border-radius: var(--radius);
}

.step-summary::-webkit-details-marker {
  display: none;             /* hide the triangle in Safari too */
}

.step-heading {
  flex: 1;
  min-width: 0;
}

/* Down arrow drawn with two borders, rotated */
.chevron {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.chevron::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border: solid var(--cyan);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.step-body[open] .chevron {
  transform: rotate(180deg);
  border-color: var(--border-strong);
}

/* Small per-phase progress bar */
.phase-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  width: 0;                  /* script.js sets the real width */
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
  transition: width 0.5s ease;
}

.phase-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* --- Phase states (classes added by script.js) --- */
.step.is-current .step-body {
  border-color: rgba(34, 211, 238, 0.35);
}

.step.is-current .step-num {
  animation: glow-pulse 2.6s ease-in-out infinite;
}

@keyframes glow-pulse {
  50% { box-shadow: 0 0 34px rgba(34, 211, 238, 0.65), inset 0 0 12px rgba(34, 211, 238, 0.25); }
}

.step.is-done .step-num {
  color: #04101a;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-color: transparent;
}

/* --- Task checklist --- */
.tasks {
  display: grid;
  gap: 2px;
  margin: 0 12px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--border);
}

.step-body[open] .tasks {
  animation: tasks-in 0.35s ease;
}

@keyframes tasks-in {
  from { opacity: 0; transform: translateY(-6px); }
}

.task {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.task:hover {
  background: rgba(34, 211, 238, 0.05);
}

/* The real checkbox: invisible but still clickable and focusable.
   It sits exactly on top of our custom box. */
.task input {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 22px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

/* Our custom-drawn box */
.task-box {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(148, 180, 255, 0.4);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* The tick mark: an L-shape rotated 45° (hidden until checked) */
.task-box::after {
  content: "";
  width: 6px;
  height: 11px;
  margin-top: -2px;
  border: solid #04101a;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
}

/* "+" means "the element right after". "~" means "any later sibling". */
.task input:checked + .task-box {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.task input:checked + .task-box::after {
  transform: rotate(45deg) scale(1);
}

.task input:focus-visible + .task-box {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.task-text {
  transition: color 0.2s ease;
}

.task input:checked ~ .task-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(139, 151, 173, 0.6);
}

/* Little "pop" when you tick a task (class added by script.js) */
.task.pop .task-box {
  animation: pop 0.4s ease;
}

@keyframes pop {
  40% { transform: scale(1.3); box-shadow: 0 0 22px rgba(34, 211, 238, 0.9); }
}


/* ---------------------------------------------------------
   10. PROJECT CARD + PHONE MOCKUP
   --------------------------------------------------------- */
.project-card {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 40px;
  overflow: hidden;
}

/* Turn off the lift for this big card — it felt too jumpy */
.project-card:hover {
  transform: none;
}

.status-chip {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
}

.project-desc {
  font-size: 1.1rem;
  margin-bottom: 26px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.features li:hover {
  color: var(--text);
}

.check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

/* --- Fake phone --- */
.phone {
  position: relative;
  width: 260px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 40px;
  background: #0b1020;
  border: 1px solid rgba(148, 180, 255, 0.2);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(59, 130, 246, 0.2);
  animation: hover-float 7s ease-in-out infinite;
}

.phone-notch {
  width: 90px;
  height: 20px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #000;
}

.phone-screen {
  padding: 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, #0f1730, #0a0f1f);
}

.app-hello {
  font-size: 0.75rem;
  color: var(--muted);
}

.app-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.app-card {
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.app-label {
  font-size: 0.7rem;
  color: var(--muted);
}

.app-big {
  font-size: 1.5rem;
  font-weight: 800;
}

.app-big span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.app-small {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 6px;
}

.progress {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 65%;              /* the "budget spent" amount */
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 10px var(--cyan);
}

.app-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.app-mini {
  display: flex;
  flex-direction: column;
  padding: 10px;
  font-size: 0.7rem;
  color: var(--muted);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.app-mini b {
  color: var(--text);
  font-size: 0.85rem;
}


/* ---------------------------------------------------------
   10b. DASHBOARD
   --------------------------------------------------------- */
.dash-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 20px;
}

.dash-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.dash-main {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.dash-big {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}

.dash-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 6px;
}

.dash-phase-name {
  font-weight: 600;
  margin-top: 4px;
}

.dash-link {
  margin-top: auto;           /* push to the bottom of the card */
  padding-top: 16px;
  font-size: 0.88rem;
  color: var(--cyan);
}

.dash-link:hover {
  text-decoration: underline;
}

#streak-note {
  margin-bottom: 16px;
}

.dash-btn {
  justify-content: center;
  margin-top: auto;           /* push to the bottom of the card */
}

/* Disabled = already done today */
.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* --- Circular progress ring (an SVG circle) ---
   The circle's outline is one long dash. Moving the dash
   (stroke-dashoffset) shows more or less of the ring. */
.ring {
  position: relative;
  flex-shrink: 0;
  width: 132px;
  height: 132px;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);  /* start the ring at 12 o'clock */
}

.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 10;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.07);
}

.ring-fill {
  stroke: url(#ring-gradient);
  stroke-linecap: round;
  stroke-dasharray: 326.73;   /* circumference = 2 × π × 52 */
  stroke-dashoffset: 326.73;  /* fully hidden = 0% */
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.6));
  transition: stroke-dashoffset 0.8s ease;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring-label strong {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.ring-label small {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Internship countdown ---
   --accent-rgb holds a colour as "red, green, blue" numbers,
   so we can write rgba(var(--accent-rgb), 0.3) for see-through
   versions. Swapping this one variable turns the card green
   when the internship has started. */
.countdown {
  --accent-rgb: 34, 211, 238;           /* cyan */
  grid-column: 1 / -1;                  /* take the whole row */
  position: relative;
  overflow: hidden;                     /* keep the scan line inside */
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  border-color: rgba(var(--accent-rgb), 0.3);
}

.countdown.is-started {
  --accent-rgb: 52, 211, 153;           /* soft success green */
}

/* A faint band of light that slowly sweeps down the card */
.countdown-scan {
  position: absolute;
  inset: 0 0 auto 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.07), transparent);
  pointer-events: none;
  animation: scan 7s linear infinite;
}

@keyframes scan {
  from { transform: translateY(-100%); }
  to   { transform: translateY(230%); }
}

.countdown-intro {
  position: relative;                   /* sit above the scan line */
  flex: 1 1 260px;
}

.countdown-label {
  color: rgb(var(--accent-rgb));
}

.countdown-title {
  font-size: 1.4rem;
}

.countdown-date {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Empty until the internship starts, then shown as a callout */
.countdown-message:not(:empty) {
  margin-top: 14px;
  padding: 12px 16px;
  font-weight: 600;
  color: rgb(var(--accent-rgb));
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.08);
}

/* Four boxes in one row */
.countdown-values {
  position: relative;
  flex: 1 1 420px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* display: grid above would beat the hidden attribute, so restore it */
.countdown-values[hidden] {
  display: none;
}

.time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.08), rgba(139, 92, 246, 0.05));
  box-shadow: inset 0 0 18px rgba(var(--accent-rgb), 0.08);
}

.time-num {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;   /* every digit same width = no jiggle */
  text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.55);
}

.time-unit {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The seconds box breathes gently */
.time-box-seconds {
  border-color: rgba(var(--accent-rgb), 0.5);
  animation: seconds-glow 2s ease-in-out infinite;
}

@keyframes seconds-glow {
  50% { box-shadow: inset 0 0 18px rgba(var(--accent-rgb), 0.12), 0 0 20px rgba(var(--accent-rgb), 0.25); }
}

/* Soft fade each time a number changes (class added by script.js) */
.time-num.tick {
  animation: tick 0.35s ease;
}

@keyframes tick {
  from { opacity: 0.35; transform: translateY(-3px); }
}

/* --- Achievements --- */
.achievements-card {
  margin-top: 20px;
  padding: 24px 28px;
}

/* This card holds many items, so no lift on hover */
.achievements-card:hover {
  transform: none;
}

.achievements-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.achievements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

/* Locked look: dashed border, grey icon */
.achievement {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 180, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}

.achievement-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.achievement svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.achievement-icon svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.achievement-name {
  font-weight: 700;
  color: var(--muted);
}

.achievement-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.achievement-status {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.achievement-status .lock {
  width: 13px;
  height: 13px;
}

/* Unlocked look: solid glowing border, bright icon */
.achievement.is-unlocked {
  border-style: solid;
  border-color: rgba(34, 211, 238, 0.45);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.09), rgba(139, 92, 246, 0.09));
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.15);
}

.is-unlocked .achievement-icon {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  border-color: transparent;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.5);
}

.is-unlocked .achievement-icon svg {
  color: #04101a;
}

.is-unlocked .achievement-name {
  color: var(--text);
}

.is-unlocked .achievement-status {
  color: var(--cyan);
}

.is-unlocked .lock {
  display: none;
}

/* Brief flash at the moment of unlocking */
.achievement.just-unlocked {
  animation: unlock-flash 1s ease;
}

@keyframes unlock-flash {
  30% { transform: scale(1.04); box-shadow: 0 0 40px rgba(34, 211, 238, 0.55); }
}

/* --- Reset button: deliberately quiet --- */
.dash-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn-reset {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: underline dotted;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.btn-reset:hover {
  color: #fca5a5;
}

/* --- Confirmation dialog --- */
.dialog {
  width: calc(100% - 32px);
  max-width: 420px;
  margin: auto;
  padding: 28px;
  color: var(--text);
  background: #0b1020;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8), var(--glow);
}

.dialog[open] {
  animation: dialog-in 0.25s ease;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

/* The dark layer behind the dialog */
.dialog::backdrop {
  background: rgba(2, 4, 10, 0.7);
  backdrop-filter: blur(4px);
}

.dialog h3 {
  margin-bottom: 8px;
}

.dialog p {
  color: var(--muted);
  margin-bottom: 24px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.btn-danger {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.5);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.35);
}

/* --- Toast notifications (bottom-right pop-ups) --- */
.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;  /* never block clicks underneath */
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 0.9rem;
  border-radius: 12px;
  background: rgba(10, 15, 31, 0.94);
  border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: var(--glow), 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.4s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-icon {
  color: var(--cyan);
}

.toast.toast-hide {
  opacity: 0;
  transform: translateY(10px);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px); }
}


/* ---------------------------------------------------------
   11. FOOTER
   --------------------------------------------------------- */
.footer {
  padding: 48px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-quote {
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}


/* ---------------------------------------------------------
   12. SCROLL REVEAL
   Elements start invisible and slightly lower.
   script.js adds "is-visible" when they scroll into view.
   We only hide them if JS is running (html has class "js"),
   so the page still works if JavaScript is turned off.
   --------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}


/* ---------------------------------------------------------
   13. RESPONSIVE (screens 900px wide or smaller)
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .hero,
  .project-card {
    grid-template-columns: 1fr;  /* stack into one column */
  }

  .hero {
    min-height: auto;
    gap: 40px;
  }

  .hero-visual {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
  }

  .project-card {
    padding: 28px;
  }

  /* Dashboard: two columns, big progress card on its own row */
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 72px 16px;
  }

  /* Squeeze the navbar so everything fits on a phone */
  .nav-links {
    gap: 14px;
    font-size: 0.82rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  .editor-code {
    font-size: 0.75rem;
    padding: 16px;
  }

  .tag-2 { left: 0; }
  .tag-4 { right: 0; }

  .step {
    gap: 16px;
  }

  .step-num {
    width: 44px;
    height: 44px;
    font-size: 0.85rem;
  }

  .timeline::before {
    left: 21px;
  }

  .step-summary {
    padding: 14px 16px;
  }

  .tasks {
    margin: 0 6px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .ring {
    width: 112px;
    height: 112px;
  }

  .achievements-card {
    padding: 20px;
  }

  /* Countdown: a clean 2 × 2 grid on phones */
  .countdown-values {
    grid-template-columns: repeat(2, 1fr);
  }

  .toasts {
    left: 16px;
    right: 16px;
    bottom: 16px;
    align-items: stretch;
  }
}

/* Very narrow phones: drop the badge so the links still fit */
@media (max-width: 380px) {
  .badge {
    display: none;
  }
}


/* ---------------------------------------------------------
   14. REDUCED MOTION
   Some people get dizzy from animation. If their device
   asks for less motion, we switch animations off.
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  /* A frozen scan band would look like a smudge, so hide it */
  .countdown-scan {
    display: none;
  }
}
