/*
  ============================================================
  site.css : how the whole V2 site LOOKS
  ============================================================
  One stylesheet for every page. Sections:
    1. Theme variables        8. Galleries & placeholders
    2. Reset & basics         9. Page-specific blocks
    3. Typography            10. 3D viewer
    4. Buttons, chips, badges 11. Page variants (industrial, guitar, growth)
    5. Header & nav          12. Right-to-left (Arabic) fixes
    6. Cards (hover-lift)    13. Reduced motion
    7. Timelines & flows     14. Small screens

  NEW in V2: "logical properties". Instead of margin-left we write
  margin-inline-start, which means "the side where text STARTS".
  In English that's the left; in Arabic (right-to-left) it's the
  right. So most of the layout mirrors itself for Arabic for free.
*/


/* ===================== 1. THEME VARIABLES ===================== */
:root {
  --bg: #0b0907;              /* deep warm black */
  --surface: #16110d;         /* cards */
  --surface-2: #1f1812;       /* raised bits inside cards */
  --line: #4a2e18;            /* orange-brown hairlines */
  --accent: #ff7a1a;            /* the main accent */
  --accent-light: #ffa552;      /* hover / highlights */
  --text: #f5ebe0;            /* warm off-white */
  --muted: #a8927e;           /* secondary text */
  --glow: 0 18px 48px -18px rgba(var(--accent-rgb), 0.45);

  /* The same colours as plain numbers, so rgba() can fade them (rgba(var(--accent-rgb), 0.3)).
     A page theme (like the purple guitar page) changes these and every glow follows. */
  --accent-rgb: 255, 122, 26;
  --accent-light-rgb: 255, 165, 82;
  --line-rgb: 74, 46, 24;
  --rivet-hi: #6b4426;
  --rivet-lo: #3a2416;
  --brand-icon: var(--gear-icon);   /* the logo always keeps its gear, even on themed pages */
  --spot-core-rgb: 255, 214, 170;   /* the hot centre of the card spotlight (section 25) */

  /* ---- "Gears era" pieces ----
     --gear-icon is a tiny gear drawn in SVG. CSS uses it as a MASK: the
     element is painted orange, and the mask cuts it into a gear shape.
     Used for bullets, timeline dots, labels and the logo. */
  --gear-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-10 -10 20 20'%3E%3Ccircle r='5.6' fill='none' stroke='%23000' stroke-width='4'/%3E%3Cg fill='%23000'%3E%3Crect x='-1.8' y='-10' width='3.6' height='5'/%3E%3Crect x='-1.8' y='-10' width='3.6' height='5' transform='rotate(45)'/%3E%3Crect x='-1.8' y='-10' width='3.6' height='5' transform='rotate(90)'/%3E%3Crect x='-1.8' y='-10' width='3.6' height='5' transform='rotate(135)'/%3E%3Crect x='-1.8' y='-10' width='3.6' height='5' transform='rotate(180)'/%3E%3Crect x='-1.8' y='-10' width='3.6' height='5' transform='rotate(225)'/%3E%3Crect x='-1.8' y='-10' width='3.6' height='5' transform='rotate(270)'/%3E%3Crect x='-1.8' y='-10' width='3.6' height='5' transform='rotate(315)'/%3E%3C/g%3E%3C/svg%3E");

  /* Rivets: four little bolt heads in the corners of every card, like a
     riveted steel plate. Each radial-gradient draws one dot. */
  --rivet: radial-gradient(circle, var(--rivet-hi) 0 1.2px, var(--rivet-lo) 1.6px 3px, transparent 3.4px);
  --rivets:
    var(--rivet) 6px 6px / 12px 12px no-repeat,
    var(--rivet) calc(100% - 6px) 6px / 12px 12px no-repeat,
    var(--rivet) 6px calc(100% - 6px) / 12px 12px no-repeat,
    var(--rivet) calc(100% - 6px) calc(100% - 6px) / 12px 12px no-repeat;

  --font-display: 'Chakra Petch', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --radius: 10px;               /* tighter corners: machined, not bubbly */
  --radius-sm: 8px;
  --max: 1160px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);   /* a soft "settle" curve for animations */
}

/* Japanese and Arabic get fonts that actually contain their letters.
   site.js loads these fonts only when you switch language. */
html[lang="ja"] { --font-body: 'Noto Sans JP', 'Inter', sans-serif; --font-display: 'Noto Sans JP', 'Chakra Petch', sans-serif; }
html[lang="ar"] { --font-body: 'IBM Plex Sans Arabic', 'Inter', sans-serif; --font-display: 'IBM Plex Sans Arabic', 'Chakra Petch', sans-serif; }


/* ===================== 2. RESET & BASICS ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;            /* jump links stop below the sticky header */
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;   /* no grey flash on tap: cards give their own feedback */
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.02rem;
  overflow-x: hidden;                  /* nothing may cause sideways scrolling on phones */
}

img, video, canvas, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
strong { font-weight: 600; color: var(--text); }

/* NEW: :focus-visible shows a ring only for keyboard users (not mouse clicks).
   A clear focus ring is essential for people who navigate with Tab. */
:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--accent); color: var(--bg); }

/* Hidden "Skip to content" link that appears when you press Tab */
.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: 0;
  transform: translateY(-150%);        /* hidden above the screen until a keyboard user tabs to it */
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { transform: translateY(12px); }

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;                 /* centred */
  padding-inline: 20px;
}

.section { padding-block: 88px; }
.section + .section { padding-top: 24px; }

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


/* ===================== 3. TYPOGRAPHY ===================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 7vw, 4.8rem); text-transform: uppercase; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 18px; }
h3 { font-size: 1.22rem; margin-bottom: 8px; }
h4 { font-size: 1rem; margin-bottom: 6px; }

p { color: var(--muted); }
p + p { margin-top: 14px; }

/* Small orange "eyebrow" label above headings */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}
/* a small gear in front of every label */
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-inline-end: 0.55em;
  vertical-align: -0.15em;
  background: currentColor;
  -webkit-mask: var(--gear-icon) center / contain no-repeat;
  mask: var(--gear-icon) center / contain no-repeat;
}
.currently .eyebrow::before { display: none; }

/* NEW: @keyframes describes an animation. "spin" = one full turn. */
@keyframes spin { to { transform: rotate(360deg); } }

.lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 680px;
}

.section-head { margin-bottom: 36px; max-width: 760px; }

/* The big italic quotes */
.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.4;
  color: var(--accent-light);
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 22px;
  margin-block: 36px;
  max-width: 860px;
}

.note {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 18px;
}

/* The brand mark: "engineered by chaos" */
.brandmark {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: lowercase;
}


/* ===================== 4. BUTTONS, CHIPS, BADGES ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);       /* squared-off, like a machine button */
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border: 1.5px solid var(--accent);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn:hover, .btn:focus-visible { transform: translateY(-3px); box-shadow: var(--glow); }

.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); }

.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: var(--bg); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 4px;                   /* square tags, like stamped metal labels */
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.chips li:hover { border-color: var(--accent); color: var(--accent-light); }

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 3px 11px;
  vertical-align: middle;
  white-space: nowrap;
}
.badge-solid { background: var(--accent); color: var(--bg); }


/* ===================== 5. HEADER & NAV ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 9, 7, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(var(--line-rgb), 0.6);
}

.header-inner {
  max-width: 1400px;                   /* the header is wider than the page, so the full menu fits */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
}

/* Text logo (used until assets/logo/logo.svg exists) */
.brand { display: flex; flex-direction: column; line-height: 1.1; flex-shrink: 0; }
.brand-main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  color: var(--text);
}
.brand-main b { color: var(--accent); font-weight: 700; }
/* a small gear before the logo text, turning slowly (faster on hover) */
.brand-gear {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-inline-end: 0.4em;
  vertical-align: -0.12em;
  background: var(--accent);
  -webkit-mask: var(--brand-icon) center / contain no-repeat;
  mask: var(--brand-icon) center / contain no-repeat;
  animation: spin 10s linear infinite;
}
.brand:hover .brand-gear { animation-duration: 1.5s; }
.brand-sub { padding-inline-start: 1.55em; }   /* lines up under the text, not the gear */
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--accent);
  text-transform: lowercase;
  margin-top: 3px;
}
.brand img { height: 40px; width: auto; }

.nav { display: flex; align-items: center; gap: 14px; order: 1; margin-inline-start: auto; }   /* order + auto margin: menu sits right, before the light-mode switch */
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  display: block;
  padding: 8px 7px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--accent-light); }
.nav-links a[aria-current="page"] { color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-hire { padding: 8px 16px; font-size: 0.88rem; white-space: nowrap; }

/* EN / 日本語 / عربي */
.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.lang-switch button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--muted);
  transition: background-color 0.2s, color 0.2s;
}
.lang-switch button:hover { color: var(--accent-light); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--bg); font-weight: 600; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--accent);
  font-size: 1.3rem;
}


/* ===================== 6. CARDS (hover-lift) ===================== */
.card {
  position: relative;
  background: var(--rivets), var(--surface);   /* rivets on top of the plate colour */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}

/* The lift: on mouse hover, on keyboard focus inside the card,
   and ".is-tapped" which site.js adds for a moment when you tap on a phone. */
.card:hover,
.card:focus-within,
.card.is-tapped {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.card p { font-size: 0.97rem; }
.card ul.bullets { margin-top: 10px; }

/* A whole card that's a link */
a.card { display: block; }
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;              /* NEW: centres the icon both ways in one line */
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; }
.card-arrow {
  position: absolute;
  top: 24px;
  inset-inline-end: 24px;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}
.card:hover .card-arrow { transform: translateX(4px); }

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  /* NEW: min(100%, 300px) means "300px, unless the screen is narrower" so a
     card can never overflow a small phone. */
}
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

/* Bullet lists inside cards, with small orange diamonds */
.bullets li {
  position: relative;
  padding-inline-start: 20px;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 0.96rem;
}
.bullets li::before {              /* a tiny orange gear instead of a dot */
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.5em;
  width: 11px;
  height: 11px;
  background: var(--accent);
  -webkit-mask: var(--gear-icon) center / contain no-repeat;
  mask: var(--gear-icon) center / contain no-repeat;
  transition: transform 0.6s var(--ease);
}
.card:hover .bullets li::before { transform: rotate(90deg); }   /* the gears turn when you hover the card */


/* ===================== 7. TIMELINES & FLOWS ===================== */

/* Vertical timeline: a orange line with dots */
.timeline {
  position: relative;
  border-inline-start: 2px solid var(--line);
  padding-inline-start: 28px;
  display: grid;
  gap: 26px;
  max-width: 760px;
}
.timeline li { position: relative; }
.timeline li::before {               /* each stop on the line is a gear */
  content: '';
  position: absolute;
  inset-inline-start: -39px;
  top: 4px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  -webkit-mask: var(--gear-icon) center / contain no-repeat;
  mask: var(--gear-icon) center / contain no-repeat;
}
.timeline li.now::before { animation: spin 6s linear infinite; }   /* "now" keeps turning */
.timeline .when {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  display: block;
}
.timeline .what { color: var(--text); }

/* Step flow: Concept → Design → Build ... */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
  align-items: center;
  margin-block: 20px;
}
.flow li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}
.flow li span {
  border: 1px solid var(--accent);
  color: var(--accent-light);
  background: rgba(var(--accent-rgb), 0.06);
  border-radius: 999px;
  padding: 6px 14px;
}
.flow li:not(:last-child)::after { content: '→'; color: var(--accent); }


/* ===================== 8. GALLERIES & PLACEHOLDERS ===================== */
.gallery {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  margin-top: 24px;
}
/* A single-photo slot (About) fills its whole column instead of being a small tile */
.gallery[data-limit="1"] {
  grid-template-columns: 1fr;
}

.gallery button {                  /* each photo is a button that opens the lightbox */
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.gallery button:hover { transform: translateY(-4px); border-color: var(--accent); }
.gallery picture { display: block; width: 100%; height: 100%; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

/* "tall" galleries (the bikes): portrait boxes for phone photos, three across */
.gallery.tall { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.gallery.tall button, .gallery.tall .ph { aspect-ratio: 3 / 4; }

/* A single photo (About) is shown whole, not cropped to a box */
.gallery[data-limit="1"] button { aspect-ratio: auto; }
.gallery[data-limit="1"] img { height: auto; }

/* "Photo coming soon": shown when a folder has no images yet */
.ph {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at 50% 40%, rgba(var(--accent-rgb), 0.08), transparent 70%),
    var(--surface);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--accent);
  text-align: center;
  padding: 16px;
}
.ph svg { width: 30px; height: 30px; opacity: 0.8; }
.ph span { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--muted); }

/* Lightbox: the big photo view. NEW: <dialog> is a built-in pop-up element. */
.lightbox {
  border: none;
  background: transparent;
  max-width: 94vw;
  max-height: 92vh;
  margin: auto;
}
.lightbox::backdrop { background: rgba(6, 4, 3, 0.92); }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: var(--radius-sm); margin: 0 auto; }
.lightbox button {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 18px;
  cursor: pointer;
}


/* ===================== 9. PAGE-SPECIFIC BLOCKS ===================== */

/* --- Home hero --- */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);   /* NEW: svh = "small viewport height", ignores phone address bars */
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;                /* keeps the z-index layers below contained in the hero */
}

.hero-photo {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(62%, 62.5rem);          /* on very wide screens it would run under the text (rem: scales on 4K) */
  z-index: -2;
  background-size: cover;
  background-position: center 72%;  /* low enough to keep the grinder and sparks in the frame */
  /* NEW: mask-image fades the photo itself into the black page. Black in a
     mask = visible, transparent = invisible. Two masks are combined: a fade
     from the text side, and a fade at the bottom, so there's no hard edge. */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.7) 20%, #000 42%), linear-gradient(to top, transparent 0%, #000 14%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.7) 20%, #000 42%), linear-gradient(to top, transparent 0%, #000 14%);
  mask-composite: intersect;
}

/* Placeholder "photo" when zynx/ is empty: a warm glow like a grinder's sparks */
.hero-photo.is-empty {
  background:
    radial-gradient(ellipse 45% 40% at 62% 52%, rgba(var(--accent-light-rgb), 0.22), transparent 70%),
    radial-gradient(ellipse 70% 60% at 70% 60%, rgba(var(--accent-rgb), 0.10), transparent 75%);
}

/* width/height 100%: a canvas is 300×150 by default unless told otherwise */
.sparks { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* ---- The turning gears (drawn by site.js → addGears) ----
   A cluster of real interlocking gears sits in the corner of every
   page header. They mesh properly: a small gear turns faster than a big one. */
.gears {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  top: -70px;
  /* push the cluster out to the edge of the SCREEN, not the centred content box */
  inset-inline-end: min(-90px, calc((100% - 100vw) / 2 - 60px));
  width: min(560px, 75vw);
  opacity: 0.9;
}
.gears svg { width: 100%; height: auto; overflow: visible; }
.gear-body {
  fill: rgba(var(--accent-rgb), 0.045);
  stroke: rgba(var(--accent-rgb), 0.38);
  stroke-width: 1.3;
  fill-rule: evenodd;               /* NEW: makes the inner circles into holes */
}
.gear-axle { fill: rgba(var(--accent-rgb), 0.45); }
/* Home hero: the gears sit in the bottom corner, under the faded edge of the photo */
.hero .gears { top: auto; bottom: -170px; inset-inline-end: -110px; width: min(520px, 80vw); opacity: 0.75; }
/* Once the hero photo is in, the gears move to the bottom-left so they never sit on the photo */
@media (min-width: 1025px) {
  .hero:not(:has(.hero-photo.is-empty)) .gears { inset-inline-end: auto; inset-inline-start: -230px; bottom: -250px; width: 440px; opacity: 0.5; }
}
@media (max-width: 860px) {
  /* quieter, smaller and further into the corner on phones, so they stay out from behind the headings */
  .gears { opacity: 0.4; width: 300px; top: -150px; inset-inline-end: -130px; }
  .hero .gears { opacity: 0.4; }
}

.hero-text { max-width: 38.75rem; padding-block: 60px; }   /* rem: grows with the text on big screens */
.hero h1 { margin-block: 18px 10px; }
.hero .tagline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: var(--text);
  font-weight: 500;
}
.hero .brandmark { display: block; margin-top: 14px; font-size: 0.95rem; }

/* --- Inner page heroes --- */
.page-hero {
  padding-block: 92px 40px;
  position: relative;
  overflow: visible;                 /* let the gears and glow spill past the centred box (no hard edge) */
  isolation: isolate;                /* keeps the glow and sparks behind the text, inside the hero */
}
.page-hero::before {                 /* a soft orange glow in the corner */
  content: '';
  position: absolute;
  inset-inline-end: -10%;
  top: -40%;
  width: 60%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.12), transparent 65%);
  z-index: -1;
}
.page-hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); margin-bottom: 14px; }

/* --- "Currently" strip --- */
.currently {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.currently .eyebrow { margin: 0; }
.currently li { color: var(--text); display: flex; align-items: center; gap: 8px; }
.currently li:not(.eyebrow)::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

/* --- Projects: big panels that open --- */
/* NEW: <details> + <summary> is a built-in open/close box. No JS needed. */
.project { padding: 0; overflow: hidden; }
.project > summary {
  list-style: none;
  cursor: pointer;
  padding: 28px;
  display: grid;
  gap: 10px;
}
.project > summary::-webkit-details-marker { display: none; }
.project-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.project-title h3 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.8rem); }
.project .toggle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 4px;
}
.project .toggle::after { content: ' +'; }
.project[open] .toggle::after { content: ' −'; }
.project-body { padding: 0 28px 30px; border-top: 1px solid var(--line); padding-top: 26px; }
.project.featured { grid-column: 1 / -1; border-color: var(--accent); }
.project.featured > summary { padding: 38px 32px; }
.project:hover, .project:focus-within { transform: translateY(-4px); }
.project[open]:hover,
.project[open]:focus-within { transform: none; }   /* don't float the open panel while reading */

.ppr { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-block: 10px 24px; }
.ppr > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 18px; border: 1px solid rgba(var(--line-rgb), 0.6); }
.ppr h4 { color: var(--accent); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }

.stack-row { margin-top: 18px; }

/* --- Two columns (garage, about) --- */
.split { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; align-items: start; }
.bike-head { margin-bottom: 18px; }
.bike-head .nick { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); color: var(--accent); line-height: 1; }
.bike-col { display: grid; gap: 16px; }
.tagline-small { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); display: block; margin-bottom: 6px; }

/* --- Growth log --- */
.gap-card dl { display: grid; gap: 12px; margin-top: 12px; }
.gap-card dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.gap-card dd { color: var(--muted); font-size: 0.95rem; }
.progress {
  height: 10px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-top: 18px;
  overflow: hidden;
}
/* The fill looks like a moving conveyor belt: diagonal stripes sliding along */
.progress span {
  display: block;
  height: 100%;
  width: 0;                          /* site.js sets the real width */
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.22) 0 6px, transparent 6px 12px),
    linear-gradient(90deg, var(--accent), var(--accent-light));
  background-size: 17px 17px, auto;
  transition: width 1.2s var(--ease);
  animation: conveyor 1.2s linear infinite;
}
@keyframes conveyor { to { background-position: 17px 0, 0 0; } }
.progress-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); margin-top: 6px; }

/* --- Song panel --- */
.song-panel {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: clamp(26px, 5vw, 48px);
  background: radial-gradient(circle at 20% 0%, rgba(var(--accent-rgb), 0.14), transparent 60%), var(--surface);
  text-align: center;
}
.song-title { font-family: var(--font-display); font-size: clamp(2.2rem, 7vw, 4rem); color: var(--accent-light); margin-block: 6px 12px; }
.song-embed { margin-top: 24px; border-radius: var(--radius-sm); overflow: hidden; }
.song-embed iframe { width: 100%; border: 0; }

/* --- Videos (from V1) --- */
.video-frame { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: #000; }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; }
.video-vertical { aspect-ratio: 9 / 16; }
.shorts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); margin-top: 20px; }

/* --- Contact form --- */
.contact-grid { display: grid; gap: 28px; grid-template-columns: 1fr 1.3fr; align-items: start; }
.contact-links { display: grid; gap: 12px; }
.contact-links a { display: flex; align-items: center; gap: 10px; color: var(--text); word-break: break-word; }
.contact-links a:hover { color: var(--accent-light); }
.contact-links svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 0.88rem; color: var(--muted); }
.form input, .form textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 0.2s;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); }
.form textarea { min-height: 140px; resize: vertical; }
.form-status { font-size: 0.9rem; color: var(--accent-light); min-height: 1.4em; }

/* --- Facts list (About) --- */
.facts { display: grid; gap: 14px; }
.facts dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.facts dd { color: var(--text); }


/* --- "Hire me" band at the bottom of every page --- */
.cta-band {
  margin-block: 40px 80px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: clamp(28px, 6vw, 56px);
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--accent-rgb), 0.16), transparent 65%),
    var(--surface);
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { margin-inline: auto; max-width: 560px; }
.cta-band .btn-row { justify-content: center; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--line); padding-block: 44px 32px; }
.footer-inner { display: grid; gap: 24px 48px; grid-template-columns: 1fr auto; align-items: start; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--accent-light); }
.footer-links { display: grid; gap: 6px; font-size: 0.92rem; }
/* The footer description uses the same small code-style font as the © line */
.copyright, .footer-note { font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.7; color: var(--muted); }
.copyright { margin-top: 28px; }
.footer-note { margin-top: 14px; max-width: 360px; }

/* --- 404 --- */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.lost .code { font-family: var(--font-mono); font-size: clamp(4rem, 18vw, 9rem); color: var(--accent); line-height: 1; }


/* ===================== 10. 3D VIEWER (assets/js/viewer.js) ===================== */
.model-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 35%, #26180e, var(--bg) 75%);
  cursor: grab;
}
.model-frame:active { cursor: grabbing; }
.model-frame canvas { width: 100%; height: 100%; }
.model-frame:fullscreen { aspect-ratio: auto; border-radius: 0; border: none; }
.viewer-status {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 16px;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
  pointer-events: none;
}
.model-frame.is-missing .viewer-status { align-items: flex-end; color: var(--accent); }
.viewer-status[hidden] { display: none; }
.viewer-btn {
  position: absolute; top: 10px; inset-inline-end: 10px;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(11, 9, 7, 0.75);
  color: var(--accent); cursor: pointer;
}
.viewer-btn:hover { border-color: var(--accent); }
.model-card { padding: 12px 12px 22px; }
.model-card .model-frame { margin-bottom: 16px; }
.model-card > :not(.model-frame) { margin-inline: 10px; }
.model-card:hover { transform: none; }   /* no wobble while dragging a model */
.model-stats { margin-top: 12px; }
.viewer-hint { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-top: 10px; }


/* ===================== 11. PAGE VARIANTS =====================
   Each page's <body> has a class like "theme-industrial". */

/* Industrial: grittier. A subtle noise texture and harder edges. */
.theme-industrial {
  --surface: #130f0b;
  --radius: 10px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.48 0 0 0 0 0.1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.theme-industrial .page-hero { min-height: 52vh; display: flex; align-items: center; }
.theme-industrial .page-hero::before { background: radial-gradient(circle, rgba(255, 110, 20, 0.18), transparent 65%); }
.theme-industrial .card { border-top: 2px solid var(--accent); }
.theme-industrial h1 { text-transform: uppercase; letter-spacing: 0.01em; }
.repair-card .eyebrow::before {      /* text tag instead of the gear here */
  content: '[FIX] ';
  -webkit-mask: none; mask: none;
  background: none;
  width: auto; height: auto;
  margin: 0;
  vertical-align: baseline;
}

/* Guitar: softer and warmer */
.theme-guitar {
  --surface: #1a120b;
  --radius: 20px;
  background: radial-gradient(ellipse at 50% -10%, #2e1708 0%, var(--bg) 55%) fixed, var(--bg);
}
.theme-guitar .card { border-color: rgba(var(--accent-rgb), 0.3); }

/* Growth: quieter, less glow */
.theme-growth { --glow: 0 12px 30px -16px rgba(var(--accent-rgb), 0.3); }
.theme-growth .page-hero::before { opacity: 0.5; }


/* ===================== 12. RIGHT-TO-LEFT (Arabic) =====================
   Logical properties already mirror most things. These are the rest. */
[dir="rtl"] .flow li:not(:last-child)::after { content: '←'; }
[dir="rtl"] .card:hover .card-arrow { transform: translateX(-4px); }
[dir="rtl"] .card-arrow { transform: scaleX(-1); }
[dir="rtl"] .hero-photo {
  -webkit-mask-image: linear-gradient(to left, transparent 0%, rgba(0, 0, 0, 0.7) 20%, #000 42%), linear-gradient(to top, transparent 0%, #000 14%);
  mask-image: linear-gradient(to left, transparent 0%, rgba(0, 0, 0, 0.7) 20%, #000 42%), linear-gradient(to top, transparent 0%, #000 14%);
}
[dir="rtl"] .progress span {
  background:
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.22) 0 6px, transparent 6px 12px),
    linear-gradient(-90deg, var(--accent), var(--accent-light));
  background-size: 17px 17px, auto;
  animation-direction: reverse;
}
[dir="rtl"] .gears { transform: scaleX(-1); }   /* mirror the gear cluster too */
/* The code-style font has no Arabic letters, so Arabic labels use the Arabic font */
html[lang="ar"] { --font-mono: 'IBM Plex Sans Arabic', 'JetBrains Mono', monospace; }
/* Arabic letters JOIN together. Extra letter-spacing breaks the joins, so turn it off. */
html[lang="ar"] * { letter-spacing: 0 !important; }


/* ===================== 13. SCROLL REVEAL & REDUCED MOTION ===================== */
/* "js" is added to <html> by a tiny inline script, so if JavaScript is off
   nothing stays invisible. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* NEW: some people get dizzy from motion and turn it off in their system
   settings. This media query respects that choice. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .card:hover, .card:focus-within, .card.is-tapped, .btn:hover, .gallery button:hover { transform: none; }
  .sparks { display: none; }
}


/* ===================== 14. SMALLER SCREENS ===================== */

/* Nav collapses earlier than other things, because it has a lot of links */
@media (max-width: 1400px) {
  .menu-toggle { display: grid; place-items: center; }
  .header-inner .theme-toggle { order: 0; margin-inline-start: auto; }   /* phones: switch sits next to the ☰ button */
  .nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 20px 22px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .nav.open { display: flex; }
  /* One column of links on phones, two or three side by side on tablets */
  .nav-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
  .nav-links a { padding: 12px 10px; font-size: 1rem; }
  .nav-actions { justify-content: space-between; flex-wrap: wrap; }
}

/* ---- TABLETS (861–1100px; phones have their own gear size in section 9) ---- */
@media (min-width: 861px) and (max-width: 1100px) {
  /* smaller gear cluster, tucked higher, so it stays out of the opening paragraph */
  .gears { width: 380px; top: -140px; }
}

/* ---- TABLETS + PHONES (up to 1024px): the hero photo goes BEHIND the text ----
   Side by side only works on wide screens; on a tablet the text would sit on
   top of the photo's face. */
@media (max-width: 1024px) {
  .hero { align-items: end; }
  .hero-photo {
    width: 100%;
    opacity: 0.45;
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 92%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 92%);
  }
  [dir="rtl"] .hero-photo {
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 92%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 92%);
  }
  .hero-text { padding-block: 120px 56px; }
  /* No photo in zynx/ yet? Then don't leave a screen of empty space above the text.
     NEW: :has() means "a .hero that CONTAINS an .is-empty photo". */
  .hero:has(.hero-photo.is-empty) { min-height: auto; }
  .hero:has(.hero-photo.is-empty) .hero-text { padding-block: 96px 64px; }
  .hero-photo { background-position: center 25%; }   /* phones/tablets: keep the face in view behind the text */
  /* gears drop below the text and buttons instead of sitting behind them */
  .hero .gears { width: 340px; bottom: -230px; inset-inline-end: -130px; }
}

/* ---- PHONES (up to 860px) ---- */
@media (max-width: 860px) {
  .split, .contact-grid, .footer-inner { grid-template-columns: 1fr; }
  .section { padding-block: 64px; }
}

/* ---- SMALL PHONES (up to 480px) ---- */
@media (max-width: 480px) {
  .card { padding: 20px; }
  .project > summary, .project.featured > summary { padding: 22px; }
  .project-body { padding: 20px 16px 22px; }
  .ppr > div { padding: 14px; }          /* less boxed-in padding, so text gets the width */
  .section-head { margin-bottom: 26px; }
  .btn { padding: 11px 20px; }
  .lang-switch button { padding: 5px 7px; }
}


/* ===================== 15. TOUCH SCREENS =====================
   "(pointer: coarse)" = the device is used with a finger (phones, tablets). */

/* The "Tap to rotate" label on 3D models. viewer.js adds .is-active after a tap. */
.viewer-tap {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(11, 9, 7, 0.8);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;            /* the tap goes through to the model */
}
@media (pointer: coarse) {
  .model-frame:not(.is-active) .viewer-tap { display: block; }
  .model-frame.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.35); }

  /* Bigger tap targets for fingers */
  .lang-switch button { min-height: 36px; padding-inline: 11px; }
  .chips li { padding-block: 8px; }
}


/* ===================== 16. EASTER EGG: THE "LIGHT MODE" SWITCH =====================
   It looks like a normal dark/light switch. It refuses to work.
   site.js → setupLightModeEgg() adds .is-trying (1st & 2nd tap) or .is-refusing (3rd+). */
.theme-toggle {
  order: 2;                         /* desktop: after the menu, at the far end of the header */
  position: relative;
  flex-shrink: 0;
  width: 54px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); }

/* the sun waiting on the far side */
.tt-sun {
  position: absolute;
  top: 50%;
  inset-inline-end: 7px;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0.7;
}
.tt-sun svg, .tt-knob svg { width: 100%; height: 100%; display: block; }

/* the knob, wearing a moon */
.tt-knob {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  padding: 4px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
}

/* Tries 1 and 2: slide towards the sun, hesitate, get yanked back */
.theme-toggle.is-trying .tt-knob { animation: egg-try 0.9s var(--ease); }
@keyframes egg-try {
  0%   { transform: none; }
  30%  { transform: translateX(26px); background: #fff4e0; }
  50%  { transform: translateX(26px); background: #fff4e0; }
  100% { transform: none; }
}
[dir="rtl"] .theme-toggle.is-trying .tt-knob { animation-name: egg-try-rtl; }
@keyframes egg-try-rtl {
  0%   { transform: none; }
  30%  { transform: translateX(-26px); background: #fff4e0; }
  50%  { transform: translateX(-26px); background: #fff4e0; }
  100% { transform: none; }
}

/* Try 3+: the whole switch shakes its head */
.theme-toggle.is-refusing { animation: egg-shake 0.5s ease; border-color: var(--accent); }
@keyframes egg-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Try 2: a soft, single "flashbang". Faint on purpose (it's a joke, not a real flash). */
.egg-flash {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #fff4e0;
  pointer-events: none;
  animation: egg-flash 0.7s ease-out forwards;
}
@keyframes egg-flash {
  0%   { opacity: 0; }
  15%  { opacity: 0.35; }
  100% { opacity: 0; }
}

/* The message box under the header */
.egg-toast {
  position: fixed;
  z-index: 60;
  top: 78px;
  inset-inline-end: 20px;
  max-width: min(380px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--rivets), var(--surface);
  box-shadow: var(--glow);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.egg-toast.show { opacity: 1; transform: none; }
.egg-gear {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: var(--accent);
  -webkit-mask: var(--gear-icon) center / contain no-repeat;
  mask: var(--gear-icon) center / contain no-repeat;
  animation: spin 2s linear infinite;
}


/* ===================== 17. EASTER EGG: THE CAT BELOW THE FOOTER =====================
   Made by setupFooterCat() in site.js, only once someone tries to scroll
   past the footer. It waits just below the bottom edge, then pops up.
   Hover or click it and it claws at your pointer. */
.egg-cat {
  position: fixed;
  z-index: 60;
  bottom: 0;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  pointer-events: none;
  transform: translate(-50%, 110%);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);   /* overshoots a little = "pop" */
}
.egg-cat.show { transform: translate(-50%, 0); }

.egg-cat-body {
  position: relative;
  pointer-events: auto;        /* the cat itself can be poked */
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.egg-cat-art {
  display: block;
  width: 96px;               /* 16 pixels x 6 */
  height: 96px;
  filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.45));
}
.egg-cat.show .egg-cat-art { animation: cat-idle 1.6s steps(1) infinite; }
@keyframes cat-idle {          /* a choppy, 8-bit style breathing bob */
  0%, 50%, 100% { transform: translateY(0); }
  25%           { transform: translateY(-4px); }
}
.egg-cat-art .px-e, .egg-cat-art .px-p { animation: cat-blink 3.4s steps(1) infinite; }
@keyframes cat-blink {
  0%, 92%, 100% { opacity: 1; }
  94%, 98%      { opacity: 0; }
}

/* The swipe: the cat leans in, the paw shoots out toward the pointer */
.egg-cat.is-clawing .egg-cat-art { animation: cat-lean 0.4s steps(2); }
.egg-cat.is-clawing.lean-left .egg-cat-art { animation-name: cat-lean-left; }
@keyframes cat-lean      { 50% { transform: translateY(3px) rotate(6deg); } }
@keyframes cat-lean-left { 50% { transform: translateY(3px) rotate(-6deg); } }

.egg-paw {
  position: absolute;
  left: 40%;
  top: 55%;
  width: 28px;               /* 7 pixels x 4 */
  height: 32px;
  margin: -32px 0 0 -14px;   /* put its bottom-centre on the chest */
  transform-origin: 50% 100%;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.6));
}
.egg-cat.is-clawing .egg-paw { animation: cat-swipe 0.38s steps(4); }
@keyframes cat-swipe {
  0%   { opacity: 1; transform: translate(0, 0) rotate(var(--rot)) scale(0.5); }
  45%  { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1.1); }
  100% { opacity: 0; transform: translate(0, 0) rotate(var(--rot)) scale(0.5); }
}

/* Three claw marks where the pointer was */
.egg-scratch {
  position: fixed;
  z-index: 61;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: rotate(-25deg);
  animation: scratch-fade 0.7s ease-in forwards;
}
.egg-scratch span {
  width: 4px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform-origin: top;
  animation: scratch-draw 0.12s steps(3) both;
}
.egg-scratch span:nth-child(2) { animation-delay: 0.04s; margin-top: -4px; }
.egg-scratch span:nth-child(3) { animation-delay: 0.08s; }
@keyframes scratch-draw { from { transform: scaleY(0); } }
@keyframes scratch-fade { 0%, 50% { opacity: 1; } 100% { opacity: 0; } }

/* The chat bubble: square "pixel" corners and a stepped tail */
.egg-bubble {
  position: relative;
  margin: 0;
  padding: 10px 16px;
  max-width: calc(100vw - 32px);
  background: var(--bg);
  color: var(--accent-light);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-radius: 0;
  /* a 4px "pixel" border drawn with shadows, so the corners stay notched */
  box-shadow:
    0 -4px 0 0 var(--accent), 0 4px 0 0 var(--accent),
    -4px 0 0 0 var(--accent), 4px 0 0 0 var(--accent);
}
.egg-bubble::after {             /* the tail: two stacked squares pointing at the cat */
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  background: var(--accent);
  transform: translateX(-50%);
  box-shadow: 0 6px 0 -1px var(--accent);
}


/* ===================== 18. EVERY SCREEN SIZE =====================
   Extra fixes so the site holds up from a folded phone (280px wide)
   to a 4K monitor, in portrait and landscape. */

/* The decorative gears spill past the screen edge on purpose. "clip" cuts
   them off at the edge WITHOUT making a scroll box, so phones (iPhones
   especially) can't be swiped sideways. Older browsers get "hidden". */
main { overflow-x: clip; }
@supports not (overflow: clip) { main { overflow-x: hidden; } }

/* The phone menu: "dvh" = the height you can actually see, with the
   browser's address bar taken into account */
@media (max-width: 1400px) {
  .nav { max-height: calc(100dvh - 64px); }
}
.menu-toggle { flex-shrink: 0; }

/* ---- SMALL PHONES (up to 380px: iPhone SE, small Androids) ---- */
@media (max-width: 380px) {
  .container { padding-inline: 14px; }
  .header-inner { gap: 8px; }
  .brand-main { font-size: 0.9rem; }
  .brand-sub { font-size: 0.55rem; letter-spacing: 0.22em; }
  h1 { font-size: 2.2rem; }
  .page-hero h1 { font-size: 2rem; }
  .card { padding: 18px; }
}

/* ---- FOLDED PHONES (up to 300px: Galaxy Z Fold outer screen) ---- */
/* the hero badge may wrap onto two lines on tiny screens instead of being cut off */
@media (max-width: 380px) {
  .hero .badge { white-space: normal; line-height: 1.5; }
}
@media (max-width: 300px) {
  .container { padding-inline: 12px; }
  .header-inner { gap: 6px; }
  .brand-main { font-size: 0.8rem; }
  .brand-sub { display: none; }
  .menu-toggle { width: 38px; height: 38px; }
  h1 { font-size: 1.9rem; }
  .page-hero h1 { font-size: 1.75rem; }
  .btn { padding: 10px 16px; }
}

/* ---- PHONES ON THEIR SIDE (landscape: wide but very short) ---- */
@media (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: auto; }
  .hero-text { padding-block: 72px 48px; }
  .page-hero { padding-block: 56px 28px; }
  .section { padding-block: 48px; }
  .egg-toast { top: 70px; }
  .egg-cat-art { width: 72px; height: 72px; }   /* the footer cat takes less of the short screen */
}

/* ---- FINGERS: footer links get a proper tap area ---- */
@media (pointer: coarse) {
  .footer-links { gap: 0; }
  .footer-links a { padding-block: 8px; }
}

/* ---- BIG SCREENS: everything scales up a little so it isn't a thin
   strip in the middle of a huge monitor. Sizes in "rem" grow with the
   html font size; the header and page widths grow to match. ---- */
@media (min-width: 1800px) {
  html { font-size: 112.5%; }
  :root { --max: 1360px; }
  .header-inner { max-width: 1640px; }
}
@media (min-width: 2400px) {
  html { font-size: 131.25%; }
  :root { --max: 1600px; }
  .header-inner { max-width: 1960px; }
  .theme-toggle { transform: scale(1.2); }
}
@media (min-width: 3400px) {
  html { font-size: 175%; }
  :root { --max: 2100px; }
  .header-inner { max-width: 2600px; }
  .theme-toggle { transform: scale(1.6); }
}


/* ===================== 19. EASTER EGG: HOLD THE LOGO (home page) =====================
   site.js -> setupTwinEgg(). Hold the header logo for 5 seconds. */
.brand {
  -webkit-touch-callout: none;     /* phones: no "open link / copy" menu on a long press */
  -webkit-user-select: none;
  user-select: none;
}
/* while held: the gear spins fast and the logo slowly lights up */
.brand.is-holding .brand-gear { animation-duration: 0.35s; }
.brand.is-holding .brand-main {
  text-shadow: 0 0 16px rgba(var(--accent-rgb), 0.95);
  transition: text-shadow 5s linear;
}

.egg-twin {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.egg-twin.show { opacity: 1; pointer-events: auto; cursor: pointer; }
.egg-twin-text {
  margin: 0;
  max-width: 100%;
  padding: 22px 30px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--rivets), var(--surface);
  box-shadow: var(--glow), 0 20px 60px rgba(0, 0, 0, 0.6);
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4vw, 1.6rem);
  text-align: center;
  transform: scale(0.6) rotate(-4deg);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);   /* overshoots a little = "pop" */
}
.egg-twin.show .egg-twin-text { transform: none; }


/* ===================== 20. PHONE POLISH =====================
   Fixes spotted on a real phone. */

/* The menu button: three drawn bars instead of the "☰" character (phones draw
   that character in all sorts of sizes). They fold into an X when the menu is open. */
.menu-bars { display: grid; gap: 5px; width: 20px; }
.menu-bars i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.menu-toggle[aria-expanded="true"] .menu-bars i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars i:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-bars i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* EN / 日本語 / عربي: three equal pills, each label centred the same way,
   whatever font the phone uses for Japanese and Arabic letters */
.lang-switch { align-items: center; gap: 2px; }
.lang-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 30px;
  padding: 0 10px;
  line-height: 1;
  font-family: var(--font-body);
  font-size: 0.8rem;
}
.lang-switch button[lang="ja"] { font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif; font-size: 0.78rem; }
.lang-switch button[lang="ar"] { font-family: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif; font-size: 0.86rem; padding-bottom: 2px; }
@media (pointer: coarse) {
  .lang-switch button { height: 36px; min-height: 0; min-width: 52px; padding-inline: 12px; }
}

/* "Currently": on phones, the label sits on its own line and each item gets its own row */
@media (max-width: 600px) {
  .currently { flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 20px; }
  .currently .eyebrow { margin-bottom: 2px; }
}

/* A small, lower-resolution video (the robotic arm clip is 720p): keep it at a
   size where it still looks sharp, and let it keep its own shape (portrait or landscape) */
.video-small { max-width: 720px; }
.video-small .video-frame { aspect-ratio: auto; }
.video-small video { width: 100%; height: auto; max-height: 75vh; display: block; margin-inline: auto; }


/* ===================== 21. NO DEAD SPACE =====================
   Layouts that fill every row, whatever the screen size. */

/* ---- Photo galleries: justified rows (site.js -> layoutGallery) ----
   Each row is a flex line; each photo grows in proportion to its shape
   (--ar = width / height), so the row is exactly full and nothing is cropped. */
.gallery.is-justified { display: flex; flex-direction: column; gap: 14px; }
.gallery .g-row { display: flex; gap: 14px; width: 100%; margin-inline: auto; }
.gallery .g-row > button { flex: var(--ar) 1 0; aspect-ratio: var(--ar); min-width: 0; }
@media (max-width: 480px) {
  .gallery.is-justified, .gallery .g-row { gap: 8px; }
}

/* ---- Card grids: the last row is always full ----
   Laptops: 3 across. If the last row would have 2 cards, they share it half
   and half; if it would have 1, the last 4 cards become two rows of 2.
   (A 6-column grid makes those halves and thirds possible.) */
@media (min-width: 1024px) {
  .grid:not(.grid-2) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid:not(.grid-2) > * { grid-column: span 2; }
  .grid:not(.grid-2):has(> :last-child:nth-child(3n+2)) > :nth-last-child(-n+2) { grid-column: span 3; }
  .grid:not(.grid-2):has(> :last-child:nth-child(3n+1)) > :nth-last-child(-n+4) { grid-column: span 3; }
  .grid:not(.grid-2) > :only-child { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Tablets: 2 across; an odd one out at the end takes the full row */
@media (min-width: 640px) and (max-width: 1023px) {
  .grid, .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Phones: one column */
@media (max-width: 639px) {
  .grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
/* A 3D model card that ends up wider than usual shouldn't get a giant, tall viewer */
.model-card .model-frame { max-height: 380px; }

/* ---- Projects: one full-width column, so opening a panel never leaves an
   empty box beside it ---- */
.projects-list { display: flex; flex-direction: column; gap: 20px; }

/* ---- Problem / Process / Result: all three side by side, or all three
   stacked, never two-and-one-left-over ---- */
.ppr { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) {
  .ppr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* ===================== 22. GARAGE: BIG BIKE SHOWCASES =====================
   Like the home page hero: each bike's photo melts into the black page on one
   side while its name and specs sit on the other. Ava = photo right, Toraa
   (.is-flipped) = photo left. Arabic mirrors both automatically. */
.bike-show { position: relative; isolation: isolate; padding-block: 72px; overflow-x: clip; }
.bike-show + .bike-show { margin-top: 24px; }

.bike-photo {
  position: absolute;
  z-index: -1;
  inset-block: 0;
  inset-inline-end: 0;
  width: 60%;
  background-size: cover;
  background-position: var(--focus, center);
  /* fade in from the text side, and soften the top and bottom edges */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.6) 22%, #000 45%),
                      linear-gradient(to bottom, transparent 0%, #000 12%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.6) 22%, #000 45%),
              linear-gradient(to bottom, transparent 0%, #000 12%, #000 86%, transparent 100%);
  mask-composite: intersect;
}
/* photo on the other side: the fade runs the other way */
.bike-show.is-flipped .bike-photo,
[dir="rtl"] .bike-show:not(.is-flipped) .bike-photo {
  -webkit-mask-image: linear-gradient(to left, transparent 0%, rgba(0, 0, 0, 0.6) 22%, #000 45%),
                      linear-gradient(to bottom, transparent 0%, #000 12%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to left, transparent 0%, rgba(0, 0, 0, 0.6) 22%, #000 45%),
              linear-gradient(to bottom, transparent 0%, #000 12%, #000 86%, transparent 100%);
}
[dir="rtl"] .bike-show.is-flipped .bike-photo {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.6) 22%, #000 45%),
                      linear-gradient(to bottom, transparent 0%, #000 12%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.6) 22%, #000 45%),
              linear-gradient(to bottom, transparent 0%, #000 12%, #000 86%, transparent 100%);
}
.bike-show.is-flipped .bike-photo { inset-inline-end: auto; inset-inline-start: 0; }

/* the text column sits on the side away from the photo */
.bike-text { width: min(100%, 580px, 48vw); display: grid; gap: 16px; }
.bike-show.is-flipped .bike-text { margin-inline-start: auto; }
.bike-text .bike-head { margin-bottom: 4px; }
.bike-text .bike-head .nick { font-size: clamp(3rem, 8vw, 5.5rem); letter-spacing: 0.02em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.bike-text .gallery { margin-top: 0; }

/* spec cards two across; an odd last card takes the full width */
.bike-specs { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bike-specs > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---- Tablets & phones: the photo goes on top, big, fading down into the
   page, and the bike's name sits on its lower edge ---- */
@media (max-width: 1024px) {
  .bike-show { padding-block: 0 48px; }
  .bike-photo,
  .bike-show.is-flipped .bike-photo,
  [dir="rtl"] .bike-show .bike-photo {
    position: relative;
    inset: auto;
    width: 100%;
    height: min(82svh, 760px);
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  }
  .bike-text,
  .bike-show.is-flipped .bike-text { width: 100%; margin-inline-start: 0; margin-top: -150px; position: relative; }
}
@media (max-width: 600px) {
  .bike-photo, .bike-show.is-flipped .bike-photo, [dir="rtl"] .bike-show .bike-photo { height: min(72svh, 560px); }
  .bike-text, .bike-show.is-flipped .bike-text { margin-top: -120px; }
  .bike-specs { grid-template-columns: minmax(0, 1fr); }
}


/* ===================== 23. GUITAR PAGE: THE MUSIC PHOTO IS THE STAR =====================
   Reuses the home page hero (photo melting into the page, text beside it).
   The black & white photo gets a slight warm tint so it sits in the orange theme. */
.hero-music .hero-photo {
  background-position: 58% 32%;           /* keeps the face and the guitar in view */
  filter: sepia(0.28) saturate(1.35) contrast(1.06);
}
.hero-music h1 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); margin-top: 14px; }
.hero-music .hero-text .lead { margin-top: 18px; }

/* Tablets & phones: the photo at full strength on top (not dimmed behind the
   text like the home page), fading down into the title */
@media (max-width: 1024px) {
  .hero-music { display: block; min-height: 0; }
  .hero-music .hero-photo,
  [dir="rtl"] .hero-music .hero-photo {
    position: relative;
    inset: auto;
    width: 100%;
    height: min(86svh, 860px);
    opacity: 1;
    background-position: 55% 28%;
    -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
  }
  .hero-music .hero-text { padding-block: 0 48px; margin-top: -170px; position: relative; }
}
@media (max-width: 600px) {
  .hero-music .hero-photo, [dir="rtl"] .hero-music .hero-photo { height: min(76svh, 620px); }
  .hero-music .hero-text { margin-top: -130px; }
}
/* laptops: keep the text on the dark side and let the photo fade in more gently,
   so the intro never sits on the bright sky */
@media (min-width: 1025px) {
  .hero-music .hero-text { max-width: 34rem; }
  .hero-music .hero-photo {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.45) 26%, #000 55%), linear-gradient(to top, transparent 0%, #000 14%);
    mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.45) 26%, #000 55%), linear-gradient(to top, transparent 0%, #000 14%);
  }
  [dir="rtl"] .hero-music .hero-photo {
    -webkit-mask-image: linear-gradient(to left, transparent 0%, rgba(0, 0, 0, 0.45) 26%, #000 55%), linear-gradient(to top, transparent 0%, #000 14%);
    mask-image: linear-gradient(to left, transparent 0%, rgba(0, 0, 0, 0.45) 26%, #000 55%), linear-gradient(to top, transparent 0%, #000 14%);
  }
}
.hero-music .hero-text > * { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75); }


/* ===================== 24. GUITAR PAGE: BLACK & PURPLE =====================
   Only the guitar page (<body class="theme-guitar">). Every colour on the
   site comes from these variables, so changing them here repaints the whole
   page: header, buttons, cards, glows, even the footer cat. */
.theme-guitar {
  --bg: #0a0710;
  --surface: #140e1c;
  --surface-2: #1c1427;
  --line: #3d2a5c;
  --accent: #a855f7;
  --accent-light: #c98bff;
  --text: #f2ecfa;
  --muted: #a597bd;
  --accent-rgb: 168, 85, 247;
  --accent-light-rgb: 201, 139, 255;
  --line-rgb: 61, 42, 92;
  --rivet-hi: #6a4a98;
  --rivet-lo: #2c1f44;
  /* these are built from the colours above, so they're rebuilt here too */
  --glow: 0 18px 48px -18px rgba(168, 85, 247, 0.5);
  --rivet: radial-gradient(circle, var(--rivet-hi) 0 1.2px, var(--rivet-lo) 1.6px 3px, transparent 3.4px);
  --rivets:
    var(--rivet) 6px 6px / 12px 12px no-repeat,
    var(--rivet) calc(100% - 6px) 6px / 12px 12px no-repeat,
    var(--rivet) 6px calc(100% - 6px) / 12px 12px no-repeat,
    var(--rivet) calc(100% - 6px) calc(100% - 6px) / 12px 12px no-repeat;
  /* the little gear markers (bullets, labels, timeline dots) become music notes */
  --gear-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M8 1.5v11.2a3.8 3.8 0 1 0 2.2 3.4V6.2c2.3.3 4.3 1.6 5.4 3.6.6-3.9-1.7-7.2-5.4-8.3z'/%3E%3C/svg%3E");
  background: radial-gradient(ellipse at 50% -10%, #1f0f33 0%, var(--bg) 55%) fixed, var(--bg);
}
.theme-guitar .site-header { background: rgba(10, 7, 16, 0.86); }

/* the hero photo: black & white with a purple wash instead of the warm tint */
.theme-guitar .hero-music .hero-photo { filter: none; }   /* already black & white; a filter here would also grey out the purple wash */
.theme-guitar .hero-music .hero-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #8b3dff;
  mix-blend-mode: color;              /* colours the photo purple but keeps its light and shade */
  opacity: 0.5;
}

/* The footer cat follows the page colour (orange everywhere else, purple here) */
.egg-cat .px-o, .egg-cat .px-n { fill: var(--accent); }
.egg-cat .px-e { fill: var(--accent-light); }

/* ---- Floating instruments instead of gears (site.js -> addGears) ---- */
.music-line { fill: none; stroke: rgba(var(--accent-rgb), 0.45); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.music-fill { fill: rgba(var(--accent-rgb), 0.07); stroke: rgba(var(--accent-rgb), 0.45); stroke-width: 1.4; stroke-linejoin: round; }
.music-dot { fill: rgba(var(--accent-rgb), 0.5); }
.gears .music-line, .gears .music-fill { vector-effect: non-scaling-stroke; }   /* same line weight at any size */
/* the instruments: a bit stronger than the gears, and extra clusters beside the song and the journey */
.theme-guitar .gears { opacity: 0.85; }
.theme-guitar .music-line, .theme-guitar .music-fill { stroke: rgba(var(--accent-rgb), 0.6); }
[data-decor] { position: relative; isolation: isolate; }
[data-decor] > .gears { top: -60px; width: min(420px, 60vw); opacity: 0.55; }
#song > .gears { inset-inline-end: auto; inset-inline-start: min(-60px, calc((100% - 100vw) / 2 - 40px)); }
@media (max-width: 860px) { [data-decor] > .gears { opacity: 0.3; width: 280px; } }
/* the journey's cluster stays out at the screen edge, clear of the timeline text */
#song ~ [data-decor] > .gears { width: min(300px, 40vw); top: -20px; opacity: 0.4; }


/* ===================== 25. CARD SPOTLIGHT =====================
   On a computer, a card glows most RIGHT WHERE THE MOUSE IS and fades out
   from there, and its border lights up near the cursor. site.js
   (setupCardSpotlight) keeps --mx / --my = the mouse position inside the card.
   ::before = the soft glow inside the card, ::after = the lit-up border. */
.card { isolation: isolate; }       /* keeps the glow layer between the card's background and its text */

@media (hover: hover) {
  .card::before,
  .card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;            /* the glow never gets in the way of clicks */
    opacity: 0;
    transition: opacity 0.35s;
  }
  .card::before {
    z-index: -1;                     /* behind the card's text, in front of its background */
    background:
      radial-gradient(150px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--spot-core-rgb), 0.13), transparent 70%),
      radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), 0.14), transparent 62%);
  }
  .card::after {
    z-index: 1;
    inset: -1px;                     /* sits exactly on the 1px border */
    padding: 1px;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%),
      rgba(var(--spot-core-rgb), 0.95), rgba(var(--accent-rgb), 0.55) 32%, transparent 70%);
    /* keep only the 1px ring: the full box minus the inside */
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
  .project.card::after { inset: 0; }   /* project panels clip their edges */
  .card:hover::before, .card:hover::after,
  .card:focus-within::before, .card:focus-within::after { opacity: 1; }

  /* the overall glow is now quieter, so the spot under the cursor stands out */
  .card:hover,
  .card:focus-within {
    border-color: rgba(var(--accent-rgb), 0.28);
    box-shadow: 0 18px 50px -26px rgba(var(--accent-rgb), 0.45);
  }
}


/* ===================== 26. GUITAR PAGE: A SPRINKLE OF GOLD =====================
   Purple stays the main colour; gold shows up in small touches only. */
.theme-guitar {
  --gold: #e3bd62;
  --gold-rgb: 227, 189, 98;
  --spot-core-rgb: 227, 189, 98;    /* card spotlights have a gold centre here */
  --rivet-hi: #d8b056;              /* gold rivets on the cards */
  --rivet-lo: #4a3818;
}
.theme-guitar .eyebrow { color: var(--gold); }
.theme-guitar .song-title {
  background: linear-gradient(100deg, var(--gold) 0%, #f3dc9a 35%, var(--accent-light) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.theme-guitar .song-panel .badge-solid { background: var(--gold); color: #1a1205; }
.theme-guitar .timeline li.now .when { color: var(--gold); }
.theme-guitar .timeline li.now::before { background: var(--gold); }
/* two of the floating instruments are gold */
.theme-guitar .music-gold .music-line, .theme-guitar .music-gold .music-fill { stroke: rgba(var(--gold-rgb), 0.75); }
.theme-guitar .music-gold .music-fill { fill: rgba(var(--gold-rgb), 0.08); }
.theme-guitar .music-gold .music-dot { fill: rgba(var(--gold-rgb), 0.75); }


/* ===================== 27. HOLIDAY SEASON (20 Nov – 5 Jan) =====================
   site.js -> setupSeason() adds "season-xmas" to <html> only during the
   holidays. Outside those dates none of this shows. */

/* Falling snow: above the page, below the header, never blocks clicks */
.snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 45; pointer-events: none; }

/* A little Santa hat perched on the logo's gear */
.season-xmas .brand-main { position: relative; }
.season-xmas .brand-main::before {
  content: '';
  position: absolute;
  inset-inline-start: -0.3em;
  top: -0.62em;
  width: 1.15em;
  height: 0.95em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M3 15C6 6 12 2 19 4c-2 3-3 7-2 11z' fill='%23d62828'/%3E%3Crect x='1' y='13.5' width='18.5' height='4.5' rx='2.2' fill='%23fff'/%3E%3Ccircle cx='20' cy='4' r='2.7' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(-16deg);
  pointer-events: none;
}
[dir="rtl"] .season-xmas .brand-main::before { transform: scaleX(-1) rotate(-16deg); }

/* Fairy lights hanging along the bottom of the header: red, green, gold, white */
.season-xmas .site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 12px;
  pointer-events: none;
  background:
    radial-gradient(circle, #ff4d4d 0 2.6px, rgba(255, 77, 77, 0.35) 3.2px, transparent 5px) 0 0 / 56px 12px repeat-x,
    radial-gradient(circle, #3ddc84 0 2.6px, rgba(61, 220, 132, 0.35) 3.2px, transparent 5px) 14px 0 / 56px 12px repeat-x,
    radial-gradient(circle, #ffd166 0 2.6px, rgba(255, 209, 102, 0.35) 3.2px, transparent 5px) 28px 0 / 56px 12px repeat-x,
    radial-gradient(circle, #ffffff 0 2.6px, rgba(255, 255, 255, 0.3) 3.2px, transparent 5px) 42px 0 / 56px 12px repeat-x,
    linear-gradient(rgba(0, 0, 0, 0) 5px, rgba(60, 60, 60, 0.7) 5px 6px, transparent 6px);   /* the wire */
  animation: fairy-twinkle 1.6s ease-in-out infinite alternate;
}
@keyframes fairy-twinkle { from { opacity: 0.55; filter: brightness(0.85); } to { opacity: 1; filter: brightness(1.25); } }

/* The footer greeting */
.season-greeting {
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent-light);
}
.season-greeting + .copyright { margin-top: 8px; }

/* ===================== 28. FEATURED BADGE EASTER EGG (projects page) ===================== */
.egg-badge { cursor: pointer; user-select: none; transition: transform .15s ease; }
.egg-badge:hover { transform: translateY(-1px) scale(1.04); }
.egg-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.egg-badge[data-egg="1"] { animation: egg-wiggle 1.2s ease-in-out infinite; }
.egg-badge[data-egg="2"] { white-space: normal; text-transform: none; letter-spacing: .02em; }
.egg-badge.egg-pop { animation: egg-pop .35s ease-out; }
.egg-badge.egg-pop[data-egg="1"] { animation: egg-pop .35s ease-out, egg-wiggle 1.2s ease-in-out .35s infinite; }
@keyframes egg-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes egg-wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .egg-badge, .egg-badge[data-egg] , .egg-badge.egg-pop { animation: none; } }
