/*
 * Modern Dark, matched to the reference at designprompts.dev/modern-dark:
 * the platform sans at weight 600 with tight tracking, #050506 with drifting
 * indigo glows, gradient-filled cards ringed by a 6% white hairline, indigo
 * for action, a sticky frosted nav. Calm, precise, product-like.
 *
 * Each section maps to one of the reference's components:
 *   hero        → pill badge, two-tone gradient headline, glowing primary CTA
 *   about       → split: copy on the left, gradient stat numbers on the right
 *   experience  → numbered step cards
 *   skills      → bento grid with icon tiles
 *   projects    → large sponsor-style cards
 *   contact     → testimonial-style card with an author row
 */

:root[data-theme="modern"] {
  --bg: #050506;
  --fg: #ededef;
  --fg-dim: #8a8f98;
  /* The reference's indigo is 4.3:1 on the background, so it fills buttons
     (white on it is 4.7:1) while indigo *text* uses a lighter step (6.2:1). */
  --accent: #5e6ad2;
  --accent-text: #7c86e0;
  --accent-2: #7c86e0;
  --accent-3: #818cf8;
  --error: #f87171;
  --on-accent: #ffffff;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --surface: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  --link: #7c86e0;

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  --line: 1.75rem;
  --gap: 8rem;
  --pad-x: 1.5rem;
  --page-max: 76rem;
  --radius: 16px;
  --transition: 300ms cubic-bezier(0.16, 1, 0.3, 1);

  --glow-title: none;
  --glow-body: none;
  --glow-accent-2: none;
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 2px 20px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 80px rgba(94, 106, 210, 0.1);
  --glow-box: var(--card-shadow);

  --crt: none; /* no scanlines here */

  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;

  body { font-variant-ligatures: normal; }
  ::selection { background: rgba(94, 106, 210, 0.3); color: #fff; }

  :focus-visible {
    background: transparent;
    color: inherit;
    outline: 2px solid rgba(94, 106, 210, 0.7);
    outline-offset: 2px;
    border-radius: 8px;
  }
  a { text-decoration: none; }
  a:hover { color: #fff; }

  h1, h2, h3 { font-weight: 600; text-transform: none; }

  /* ---- The backdrop: radial falloff plus drifting indigo glows ---------- */

  .backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(ellipse at top, #0a0a0f 0%, #050506 50%, #020203 100%);
  }
  .backdrop__sun {
    position: absolute; top: -20%; left: 50%;
    width: 1400px; height: 900px; max-width: 160vw;
    translate: -50% 0;
    border-radius: 50%;
    background: linear-gradient(to top right, rgba(94, 106, 210, 0.25), rgba(94, 106, 210, 0.1), rgba(99, 102, 241, 0.05));
    filter: blur(150px);
    animation: float 12s ease-in-out infinite;
  }
  .backdrop__grid {
    position: absolute; top: 30%; left: -10%;
    width: 800px; height: 600px; max-width: 120vw;
    border-radius: 50%;
    background: linear-gradient(to bottom right, rgba(147, 51, 234, 0.15), rgba(236, 72, 153, 0.08), transparent);
    filter: blur(120px);
    animation: float 14s ease-in-out -4s infinite;
  }

  /* ---- Layout ----------------------------------------------------------- */

  .page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "hero" "about" "experience" "skills" "projects" "contact";
    padding-top: 0;
  }
  .page > .pane { background: none; border: 0; box-shadow: none; }
  .page > .pane > .pane__bar {
    display: flex; flex-direction: column; align-items: center; gap: 0;
    padding: 0 0 4rem;
    white-space: normal;
    text-align: center;
    background: none;
    border: 0;
    overflow: visible;
  }
  .page > .pane > .pane__body { padding: 0; }
  .pane__fill, .cmd { display: none; }

  /* Section heading: mono eyebrow, big tight heading, muted lede. */
  .eyebrow {
    display: block;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-text);
  }
  .page > .pane > .pane__bar :is(h1, h2) {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1;
    letter-spacing: -0.025em;
    color: #fff;
    /* "~/personal-projects" reads as "Personal projects" here. */
    text-transform: capitalize;
  }
  .page > .pane > .pane__bar :is(h1, h2)::first-letter { text-transform: uppercase; }
  .path { display: none; }
  /* An invisible hyphen keeps a word-sized gap: "Personal Projects". */
  .sep { color: transparent; }
  .lede { display: block; max-width: 40rem; margin-top: 1.5rem; font-size: clamp(1.125rem, 2vw, 1.5rem); line-height: 1.4; color: var(--fg-dim); }

  /* ---- Cards: one recipe for every raised surface ----------------------- */

  #about .stats, .log > li, .ls > div, .project, .page > .pane#contact > .pane__body {
    background: var(--surface);
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition), transform var(--transition);
  }
  :is(.log > li, .ls > div, .project):hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }

  /* ---- Top bar: fixed, frosted, full width ------------------------------ */

  .hero__top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 20;
    display: flex; align-items: center;
    height: 4rem;
    padding: 0 max(var(--pad-x), (100vw - var(--page-max)) / 2);
    background: rgba(5, 5, 6, 0.7);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(24px) saturate(1.5);
  }
  .brand {
    display: inline-flex; align-items: center; gap: 0.75rem;
    font-weight: 600; letter-spacing: -0.01em;
    color: #fff;
    white-space: nowrap;
  }
  .brand__mark {
    display: grid; place-items: center;
    width: 2.25rem; height: 2.25rem;
    border-radius: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(to bottom right, #7c86e0, #5e6ad2 60%, #4f46e5);
    box-shadow: 0 0 20px rgba(94, 106, 210, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  .brand__name span { color: var(--fg-dim); font-weight: 400; }
  .topnav { display: flex; gap: 2rem; }
  .topnav a { font-size: var(--text-sm); color: var(--fg-dim); transition: color 150ms; }
  .topnav a:hover { color: #fff; }

  /* ---- Buttons ---------------------------------------------------------- */

  .btn {
    --btn-h: 2.75rem; --btn-pad: 0 1.5rem;
    justify-content: center;
    font-weight: 500;
    letter-spacing: -0.025em;
    text-transform: none;
    color: #fff;
    background: var(--accent);
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(94, 106, 210, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  .btn__label { gap: 0.5rem; }
  .btn:hover, .btn:focus-visible {
    color: #fff;
    background: #6872d9;
    box-shadow: 0 0 0 1px rgba(124, 134, 224, 0.6), 0 0 30px rgba(94, 106, 210, 0.4);
    transform: translateY(-1px);
  }
  .btn:active { transform: none; }
  .btn--alt, .btn.theme-toggle {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .btn--alt:hover, .btn--alt:focus-visible, .btn.theme-toggle:hover, .btn.theme-toggle:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
  }
  .btn.theme-toggle { --btn-h: 2.25rem; --btn-pad: 0 0.9rem; margin-left: 0; font-size: var(--text-sm); }
  .btn.theme-toggle .btn__label { gap: 0.3em; } /* flex drops the trailing space inside "switch to " */

  /* ---- Hero ------------------------------------------------------------- */

  .hero {
    display: flex; flex-direction: column; align-items: center;
    padding: 12rem 0 4rem;
    text-align: center;
  }
  .hero > * + * { margin-top: 0; }
  .hero__cmd { display: none; }
  /* The status line becomes the pill badge above the headline. */
  .hero .ok {
    order: -1;
    display: inline-block; /* not flex: the <kbd> must flow inline with the text */
    margin-bottom: 2rem;
    padding: 0.35rem 1rem;
    font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em;
    color: var(--fg);
    background: rgba(94, 106, 210, 0.1);
    border: 1px solid rgba(94, 106, 210, 0.3);
    border-radius: 999px;
  }
  .hero .ok::before {
    content: "";
    display: inline-block;
    margin-right: 0.6rem;
    vertical-align: 0.05em;
    width: 0.5rem; height: 0.5rem;
    border-radius: 50%;
    background: var(--accent-3);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
    animation: ping 2s ease-in-out infinite;
  }
  .hero .ok kbd { font: inherit; }
  .hero__name {
    font-size: clamp(3rem, 9vw, 6rem);
    line-height: 1;
    letter-spacing: -0.03em;
    background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  /* The role completes the headline in indigo, like the reference's second line. */
  .hero__role {
    margin-top: 0.25rem;
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #7c86e0, #a5b4fc, #7c86e0);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: sheen 6s linear infinite;
  }
  .hero__role + .dim { max-width: 42rem; margin-top: 2rem; font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.625; color: var(--fg-dim); }
  .hero__actions { justify-content: center; gap: 1rem; margin-top: 3rem; }
  .hero__actions .btn { --btn-h: 3rem; --btn-pad: 0 2rem; font-size: 1rem; }
  .hero__actions .btn:not(.btn--alt) { box-shadow: 0 0 0 1px rgba(94, 106, 210, 0.5), 0 0 30px rgba(94, 106, 210, 0.4); }

  /* ---- About: split copy and stats -------------------------------------- */

  #about > .pane__bar { align-items: flex-start; text-align: left; padding-bottom: 2rem; }
  #about > .pane__body { display: grid; gap: 1.5rem 4rem; align-items: start; }
  #about > .pane__body > * { margin-top: 0; }
  #about > .pane__body > p:not(.cmd) { font-size: 1.125rem; line-height: 1.7; color: var(--fg-dim); }
  @media (min-width: 64rem) {
    #about > .pane__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    #about > .pane__body > p { grid-column: 1; }
    #about .stats { grid-column: 2; grid-row: 1 / span 3; }
  }
  .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; padding: 2rem; }
  .stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.35rem; }
  .stats dt { width: auto; font-size: var(--text-sm); color: var(--fg-dim); }
  .stats dd {
    min-width: 0;
    font-size: clamp(1.375rem, 2.4vw, 1.875rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
    background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0.6));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .stats > div:last-child { grid-column: 1 / -1; }
  .stats > div:last-child dd { font-size: 1rem; font-weight: 500; letter-spacing: 0; }
  .stats .bar { display: none; }

  /* ---- Experience: numbered step cards ---------------------------------- */

  .log {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: 1.5rem;
    counter-reset: step;
  }
  .log > li { counter-increment: step; position: relative; padding: 2rem; }
  .log > li + li { margin-top: 0; padding-top: 2rem; border-top: 0; }
  .log > li::before {
    content: counter(step);
    display: grid; place-items: center;
    width: 4rem; height: 4rem;
    margin-bottom: 1.75rem;
    font-size: 1.5rem; font-weight: 700;
    color: var(--accent-text);
    background: rgba(94, 106, 210, 0.1);
    border: 1px solid rgba(94, 106, 210, 0.3);
    border-radius: 16px;
    box-shadow: 40px 0 60px -20px rgba(94, 106, 210, 0.25);
  }
  .log > li > p:first-child { display: none; } /* commit hashes belong to the terminal */
  .log__meta { font-size: var(--text-sm); color: var(--fg-dim); }
  .log__title { margin-top: 0.5rem; font-size: 1.25rem; letter-spacing: -0.02em; color: #fff; }
  .log__points { margin-top: 1rem; font-size: var(--text-sm); line-height: 1.65; color: var(--fg-dim); }
  .log__points li + li { margin-top: 0.4rem; }
  .log__points li::before { content: "•"; color: var(--accent-text); }

  /* ---- Skills: bento grid with icon tiles ------------------------------- */

  .ls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
  .ls > div + div { margin-top: 0; }
  .ls > div { padding: 2rem; }
  @media (min-width: 64rem) {
    .ls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ls > div:first-child { grid-column: span 2; }
    .ls > div:last-child { grid-column: span 2; }
  }
  .ls dt { display: flex; flex-direction: column; align-items: flex-start; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
  .ls__icon {
    display: block;
    width: 2.75rem; height: 2.75rem;
    margin-bottom: 1.25rem;
    padding: 0.7rem;
    color: var(--accent-text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
  }
  .ls dd { display: block; margin-top: 0.5rem; padding: 0; font-size: var(--text-sm); line-height: 1.65; color: var(--fg-dim); }
  .ls dd > span + span::before { content: " · "; }

  /* ---- Projects: large sponsor-style cards ------------------------------ */

  .projects { grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); gap: 2rem; }
  .project { padding: 3rem; }
  .project > .pane__bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    padding: 0;
    white-space: normal;
    background: none;
    border: 0;
  }
  .project > .pane__bar h3 { font-size: clamp(1.5rem, 3vw, 1.875rem); letter-spacing: -0.02em; color: #fff; transition: color 200ms; }
  .project:hover > .pane__bar h3 { color: var(--accent-text); }
  .project .pane__status,
  .flags li {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.75rem;
    font-size: 0.75rem; font-weight: 500;
    color: var(--accent-text);
    background: rgba(94, 106, 210, 0.1);
    border: 1px solid rgba(94, 106, 210, 0.2);
    border-radius: 999px;
  }
  .project .pane__status { margin-left: auto; }
  .project .pane__status::before { content: none; }
  .project > .pane__body { padding: 1.25rem 0 0; }
  .project > .pane__body > p { font-size: 1.125rem; line-height: 1.6; color: var(--fg-dim); }
  .flags { gap: 0.5rem; }
  .project .actions { gap: 0.75rem; }

  /* ---- Contact: testimonial-style card ---------------------------------- */

  .page > .pane#contact > .pane__body {
    display: flex; flex-direction: column; gap: 1.5rem;
    max-width: 36rem;
    margin: 0 auto;
    padding: 2rem;
  }
  #contact > .pane__body > * { margin-top: 0; }
  .contact-list li { font-size: 1.125rem; font-weight: 500; }
  .contact-list li + li { margin-top: 0.6rem; }
  .contact-list .key { width: 6rem; font-size: var(--text-sm); font-weight: 400; color: var(--fg-dim); }
  .contact-list a { color: var(--fg); }
  .contact-list a:hover { color: var(--accent-text); }
  .contact-list .icon { color: var(--accent-text); }
  /* Author row under a hairline: avatar, name, role. */
  .irc-head {
    order: 1;
    display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-strong);
  }
  .irc-head::before {
    content: "A";
    grid-row: span 2;
    display: grid; place-items: center;
    width: 3rem; height: 3rem;
    border-radius: 50%;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(to bottom right, #7c86e0, #4f46e5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
  }
  .irc-head b { font-size: var(--text-sm); font-weight: 600; color: #fff; }
  .irc-head b { font-size: 0; }
  .irc-head b::after { content: "Arshdeep Singh"; font-size: var(--text-sm); }
  .irc-head span { font-size: var(--text-sm); color: var(--fg-dim); }

  /* ---- The 404 page ----------------------------------------------------- */

  #not-found { padding-top: 10rem; text-align: center; }
  #not-found .actions { justify-content: center; }
  #not-found .fail { color: var(--fg-dim); }

  /* ---- Prompt: frosted bar, mono type ----------------------------------- */

  .shell {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    background: rgba(5, 5, 6, 0.8);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(24px) saturate(1.5);
  }
  .prompt__ps1 b { color: var(--accent-text); }
  .prompt__input { color: var(--fg); }
  .prompt__input:focus-visible { outline: none; color: var(--fg); }
  .prompt__cursor { background: var(--accent-text); }

  /* ---- Footer ----------------------------------------------------------- */

  .footer { font-size: var(--text-sm); }
  .footer::before {
    content: "";
    display: block;
    margin-bottom: 2rem;
    border-top: 1px solid var(--border);
  }

  /* ---- Phones ----------------------------------------------------------- */

  @media (max-width: 48rem) {
    --gap: 5rem;
    .topnav { display: none; }
    .hero { padding-top: 8rem; }
    .hero__actions .btn { flex: 1 1 100%; }
    .project { padding: 1.75rem; }
    .stats { padding: 1.5rem; }
  }
  @media (max-width: 30rem) {
    .brand__name { display: none; }
  }
}

@keyframes float { 50% { transform: translateY(-20px); } }
@keyframes ping { 50% { box-shadow: 0 0 0 6px rgba(129, 140, 248, 0); } }
@keyframes sheen { to { background-position: -200% 0; } }
