/* ===== Design tokens ===== */
:root {
  --bg: #F5F5F0;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --muted: #5F6B63;
  --border: #E2E2DA;
  --accent: #2F5D50;
  --accent-text: #FFFFFF;
  --radius: 10px;
  --max: 1040px;
  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

/* Smooth scrolling plus gentle section snapping.
   "proximity" snaps when you stop near a section's start, but never traps you mid-section.
   --nav-h is the sticky menu's height (kept up to date by script.js). */
html {
  --nav-h: 66px;
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: var(--accent); }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 .6em;
}
h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ===== Blooming flowers background =====
   One canvas fixed to the screen, behind all content. Home has its own solid
   background, so the flowers only show from About downwards. */
.bloom-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: .08em;   /* matches the intro */
  color: var(--text);
  text-decoration: none;
}

.nav nav { position: relative; margin-left: auto; }

.nav-links {
  display: flex;
  gap: .5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  z-index: 1;   /* above the sliding pill */
  display: block;
  padding: .35rem .75rem;
  color: #5F6B63;
  text-decoration: none;
  transition: color .25s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active { color: #1A1A1A; }
.nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* One shared hover pill that slides between links (positioned by script.js) */
.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 8px;
  background: #ECECE4;
  opacity: 0;
  pointer-events: none;
  transition: transform .25s ease, width .25s ease, height .25s ease, opacity .2s ease;
}
.nav-pill.visible { opacity: 1; }

/* One shared active underline that slides to the current section's link */
.nav-underline {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s ease, width .35s ease, opacity .2s ease;
}
.nav-underline.visible { opacity: 1; }

/* Skip any sliding while things are being placed for the first time */
.nav-pill.no-slide,
.nav-underline.no-slide { transition: opacity .2s ease; }

/* Hamburger: three lines that turn into an X when open */
.nav-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 25px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: .8rem 1.5rem;
  border-radius: 6px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: transform .3s ease, background-color .3s ease, border-color .3s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: #244A40; border-color: #244A40; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: rgba(47, 93, 80, .06); }
.btn-sm { padding: .5rem 1rem; font-size: .9rem; }

/* ===== Hero ===== */
/* Full-width so the grid reaches both edges; the text stays in .hero-inner */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  scroll-snap-align: start;
}

/* Sits behind the text and ignores the mouse, so buttons and links still work */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Fills the Home screen: the panel sits in the middle, the NEXT button at the bottom */
.hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) clamp(1rem, 4vw, 2.5rem) 1.5rem;
}
.hero-inner .beam-panel { margin: auto; width: 100%; }

.eyebrow {
  font-size: .9rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 18ch; }

/* Rolling word in the Home heading, with a blinking typing cursor */
.rolling-word {
  color: var(--accent);
  padding-right: 4px;
  border-right: 3px solid var(--accent);
  animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink {
  50% { border-right-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .rolling-word { animation: none; border-right: none; padding-right: 0; }
}

.lead { font-size: 1.15rem; color: var(--muted); max-width: 58ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }

/* Home buttons: a green colour sweeps in on hover.
   From Uiverse.io by vikiWayne, adapted to the Forest Green theme:
   green instead of teal, 0.6s instead of 1s, and a gentler 1.05 scale. */
.sweep-btn {
  position: relative;
  isolation: isolate;   /* keeps the sweep layer inside the button */
  display: inline-block;
  padding: 1em 2em;
  border-radius: 5px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  outline: 2px solid var(--accent);
  overflow: hidden;
  cursor: pointer;
  transition: color 600ms ease, transform 600ms ease, outline-color 600ms ease, box-shadow 600ms ease;
}

.sweep-btn::before {
  content: "";
  position: absolute;
  left: -50px;
  top: 0;
  z-index: -1;
  width: 0;
  height: 100%;
  background-color: var(--accent);
  transform: skewX(45deg);
  transition: width 600ms ease;
}

.sweep-btn:hover,
.sweep-btn:focus-visible {
  color: #FFFFFF;
  transform: scale(1.05);
  outline-color: #8FB3A3;
  box-shadow: 4px 5px 17px -4px rgba(47, 93, 80, .45);
}

.sweep-btn:hover::before,
.sweep-btn:focus-visible::before { width: 250%; }

@media (max-width: 600px) {
  .sweep-btn { padding: .9em 1.4em; letter-spacing: 3px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .sweep-btn:hover, .sweep-btn:focus-visible { transform: none; }
}

/* ===== Border beam panel (Home) ===== */
.beam-panel {
  --beam-angle: 0deg;  /* turned by border-beam.js */
  --beam-1: #2F5D50;   /* forest green comet */
  --beam-2: #8FB3A3;   /* soft sage comet */
  --beam-size: 2px;    /* ring thickness */
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid #D6D6CC;
  border-radius: 20px;
  background: #FBFBF8;
}

.beam-content { position: relative; z-index: 1; padding: 48px; }

/* The ring: a rotating cone of colour, cut down to a thin border with a mask.
   Each comet has a long fading tail and a bright head. */
.beam-ring {
  position: absolute;
  inset: -1px; /* sits over the 1px border */
  padding: var(--beam-size);
  border-radius: 21px;
  background: conic-gradient(from var(--beam-angle),
    transparent 0deg,
    transparent 100deg,
    var(--beam-1) 170deg,
    transparent 171deg,
    transparent 280deg,
    var(--beam-2) 350deg,
    transparent 351deg);
  -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 exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* Soft glow: a blurred, faint copy of the ring */
.beam-glow {
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  filter: blur(6px);
  opacity: .35;
  pointer-events: none;
}
.beam-glow .beam-ring { inset: 0; --beam-size: 3px; }

/* Reduce motion: a still, softly lit border instead of moving comets */
@media (prefers-reduced-motion: reduce) {
  .beam-ring { background: linear-gradient(135deg, var(--beam-1), var(--beam-2) 50%, var(--beam-1)); }
  .beam-glow { opacity: .2; }
}

@media (max-width: 600px) {
  .beam-content { padding: 24px; }
  .hero h1 { font-size: 2rem; }
  .hero .lead { font-size: 1.05rem; }
}

/* ===== Sections ===== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 6.5rem) clamp(1rem, 4vw, 2.5rem) 1.5rem;
  border-top: 1px solid var(--border);
  /* Each section fills at least one screen, with its NEXT button at the bottom */
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  scroll-snap-align: start;
}
/* Sections taller than the screen don't snap, so nothing is ever cut off (set by script.js) */
.section.no-snap { scroll-snap-align: none; }

/* ===== NEXT buttons ===== */
.next-wrap {
  display: flex;
  justify-content: center;
  margin-top: auto;   /* pushes the button to the bottom of the section */
  padding-top: 3rem;
}
.hero .next-wrap { margin-top: 0; padding-top: 2rem; }

.next-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: #5F6B63;
  text-decoration: none;
  transition: color .3s ease;
}
.next-label {
  padding: .4rem 1rem;
  border-radius: 999px;
  background: #ECECE4;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: background-color .3s ease, color .3s ease;
}
.next-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: next-bounce 1.8s ease-in-out infinite;
}
.next-link.up svg { animation-name: next-bounce-up; }
.next-link:hover, .next-link:focus-visible { color: var(--accent); }
.next-link:hover .next-label, .next-link:focus-visible .next-label { background: rgba(47, 93, 80, .1); }
.next-link:focus-visible { outline: none; }
.next-link:focus-visible .next-label { outline: 2px solid var(--accent); outline-offset: 2px; }

@keyframes next-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes next-bounce-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Fade in and slide up slightly on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* Respect the "reduce motion" setting: no movement, no smooth scrolling */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  .next-link svg { animation: none; }
  *, *::before, *::after { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .project:hover,
  .stop.active .signpost, .slot:hover { transform: none; }
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 3rem;
  align-items: center;
}

/* ===== About: polaroid photo stack =====
   script.js gives each polaroid a place in the pile: data-pos 0 is on top. */
.polaroids {
  --polaroid-w: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.polaroid-stack {
  position: relative;
  width: var(--polaroid-w);
  aspect-ratio: 280 / 382;   /* photo (4:5) plus the frame */
  touch-action: pan-y;       /* vertical page scrolling still works on phones */
  user-select: none;
}

.polaroid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 12px 12px 0;
  border: 1px solid #D6D6CC;
  border-radius: 2px;
  background: #FFFFFF;
  box-shadow: 0 6px 18px rgba(26, 26, 26, .07);
  font: inherit;
  transition: transform .5s ease, box-shadow .3s ease;
}
.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  pointer-events: none;
  background: #ECECE4;
}
.polaroid-caption {
  flex: 1;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  color: #5F6B63;
}

/* The pile, like photos on a table */
.polaroid[data-pos="0"] { z-index: 3; transform: rotate(-4deg); cursor: pointer; }
.polaroid[data-pos="1"] { z-index: 2; transform: translate(10px, 4px) rotate(3deg); }
.polaroid[data-pos="2"] { z-index: 1; transform: translate(-8px, 6px) rotate(-1deg); }

/* Hover: the top photo lifts and straightens */
@media (hover: hover) {
  .polaroid-stack:hover .polaroid[data-pos="0"] {
    transform: translateY(-8px) rotate(0deg);
    box-shadow: 0 14px 28px rgba(26, 26, 26, .1);
  }
}
.polaroid[data-pos="0"]:focus { outline: none; }
.polaroid[data-pos="0"]:focus-visible {
  transform: translateY(-8px) rotate(0deg);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* The old top photo slides out to the side, then tucks in behind the pile */
.polaroid.is-leaving { animation: polaroid-out .5s ease-in-out; }
@keyframes polaroid-out {
  0% { z-index: 3; transform: rotate(-4deg); }
  50% { z-index: 3; transform: translateX(var(--slide, -60%)) rotate(-9deg); }
  51% { z-index: 0; transform: translateX(var(--slide, -60%)) rotate(-9deg); }
  100% { z-index: 0; }
}

/* Dots: which photo is on top */
.polaroid-dots { display: flex; gap: .25rem; }
.polaroid-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.polaroid-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  transition: background-color .25s ease;
}
.polaroid-dot:hover::before { background: rgba(47, 93, 80, .3); }
.polaroid-dot[aria-current="true"]::before { background: var(--accent); }
.polaroid-dot:focus { outline: none; }
.polaroid-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Reduce motion: photos swap with a simple fade, no sliding or rotation */
@media (prefers-reduced-motion: reduce) {
  .polaroid, .polaroid[data-pos] {
    transform: none !important;
    opacity: 0;
    animation: none !important;
    transition: opacity .3s ease;
  }
  .polaroid[data-pos="0"] { opacity: 1; }
}

/* Tablets and phones: photos above the text */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .polaroids { overflow-x: clip; padding-block: 12px; }   /* a sliding photo never widens the page */
}

/* Smaller polaroids on phones */
@media (max-width: 720px) {
  .polaroids { --polaroid-w: 240px; }
}

.about-text { max-width: 62ch; }
/* Justified: lines line up on both the left and right edges.
   Hyphens split long words so the gaps between words stay even. */
.about-text p {
  margin: 0 0 1.1rem;
  text-align: left;   /* was justify: left-aligned reads more evenly, especially on phones */
}
.about-text p:last-child { margin-bottom: 0; }

/* ===== Skills (inventory) ===== */
.section-subtitle { margin: -1rem 0 2.5rem; color: var(--muted); }

.inventory-layout { display: grid; gap: 2rem; align-items: start; }

.inventory {
  max-width: 640px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

/* Filter tabs */
.inventory-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.inventory-tab {
  padding: .4rem 1rem;
  border: 1px solid #D6D6CC;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
.inventory-tab:hover { color: var(--text); }
.inventory-tab.active { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.inventory-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Slot grid: 5 columns on desktop, 4 on tablet, 3 on mobile */
.slot-grid {
  --cols: 5;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 900px) { .slot-grid { --cols: 4; } }
@media (max-width: 600px) { .slot-grid { --cols: 3; } }

.slot-grid li { aspect-ratio: 1; }
.slot-grid li.hidden { display: none; }

.slot {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .4rem;
  border: 1px solid #D6D6CC;
  border-radius: 8px;
  background: #ECECE4;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease, background-color .3s ease;
}
.slot i { font-size: 1.9rem; }
.slot svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.slot-name { font-size: .72rem; line-height: 1.2; text-align: center; color: var(--muted); }

.slot:hover { transform: translateY(-3px); border-color: var(--accent); }
.slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The slot open in the Inspect card */
.slot.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface); color: var(--accent); }

/* Empty slots that fill out the last row */
.slot-empty {
  width: 100%;
  height: 100%;
  border: 1px dashed #D6D6CC;
  border-radius: 8px;
}

/* Inspect card: a bottom sheet by default */
.inspect-hint { display: none; }
.inspect {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  background: var(--surface);
  box-shadow: 0 -8px 30px rgba(26, 26, 26, .08);
  visibility: hidden;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}
.inspect.open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .3s ease, transform .3s ease;
}

/* Wide screens: the card sits beside the inventory, with a hint while nothing is open */
@media (min-width: 960px) {
  .inventory-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .inspect-area { display: grid; position: sticky; top: 90px; }
  .inspect-hint {
    display: grid;
    place-items: center;
    grid-area: 1 / 1;
    min-height: 220px;
    margin: 0;
    padding: 1.5rem;
    border: 1px dashed #D6D6CC;
    border-radius: 14px;
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
  }
  .inspect {
    position: relative;
    grid-area: 1 / 1;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: none;
    margin: 0;
    padding: 1.5rem;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(26, 26, 26, .06);
    transform: translateY(8px);
  }
}

.inspect-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease;
}
.inspect-close:hover { background: var(--bg); color: var(--text); }
.inspect-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.inspect-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.inspect-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.25rem; padding-right: 2rem; }
.inspect-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid #D6D6CC;
  background: #ECECE4;   /* light tile so the brand-coloured logos stand out */
  color: var(--text);
  font-size: 1.6rem;
}
.inspect-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.inspect-head h3 { margin: 0 0 .3rem; font-size: 1.3rem; }
.inspect-category {
  display: inline-block;
  padding: .1rem .6rem;
  border: 1px solid #D6D6CC;
  border-radius: 999px;
  font-size: .75rem;
  color: var(--muted);
}

.inspect-details { margin: 0; }
.inspect-details dt { font-size: .8rem; color: var(--muted); }
.inspect-details dd { margin: .15rem 0 .9rem; }
.inspect-details dd:last-child { margin-bottom: 0; }

/* ===== Skills: leaf shapes to match the Services and Projects cards ===== */
.inventory {
  background: #FFFFFF;
  border-color: #D6D6CC;
  border-radius: 28px 4px 28px 4px;
}
/* Smaller leaf for the slots */
.slot,
.slot-empty { border-radius: 12px 3px 12px 3px; }

/* Inspect card: green line grows along the top when it opens */
.inspect { overflow: hidden; }
.inspect::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width .35s ease .15s;
}
.inspect.open::before { width: 100%; }
.inspect-icon { border-radius: 14px 3px 14px 3px; }

/* Bottom sheet on small screens keeps square bottom corners; full leaf on wide screens */
.inspect { border-radius: 28px 4px 0 0; }
@media (min-width: 960px) {
  .inspect,
  .inspect-hint { border-radius: 28px 4px 28px 4px; }
}

/* ===== Service cards ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #CFCFC6;
  box-shadow: 0 8px 24px rgba(26, 26, 26, .06);
}
.card p { color: var(--muted); margin: 0; }

.card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  border-radius: 8px;
  background: rgba(47, 93, 80, .08);
  color: var(--accent);
}
.card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== Leaf cards (Services) ===== */
.leaf-card {
  position: relative;
  overflow: hidden;   /* keeps the top line and image inside the leaf shape */
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #D6D6CC;
  border-radius: 28px 4px 28px 4px;   /* top-left, top-right, bottom-right, bottom-left */
  outline: none;
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}

/* Thin green line that grows along the top edge on hover */
.leaf-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width .35s ease;
}

/* Big faded number in the top-right corner */
.leaf-num {
  position: absolute;
  top: 1rem;
  right: 1.4rem;
  font-family: var(--font-heading);
  font-size: 48px;
  line-height: 1;
  color: rgba(47, 93, 80, .15);
  transition: color .35s ease;
  pointer-events: none;
}

/* Hover and keyboard focus look the same (focus-within covers links inside a card) */
.leaf-card:hover,
.leaf-card:focus-visible,
.leaf-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(47, 93, 80, .4);
  box-shadow: 0 12px 28px rgba(26, 26, 26, .06);
}
.leaf-card:hover::before,
.leaf-card:focus-visible::before,
.leaf-card:focus-within::before { width: 100%; }
.leaf-card:hover .leaf-num,
.leaf-card:focus-visible .leaf-num,
.leaf-card:focus-within .leaf-num { color: rgba(47, 93, 80, .35); }

/* Services: icon box fills green and the icon tilts */
.service-card .card-icon { transition: background-color .35s ease, color .35s ease; }
.service-card .card-icon svg { transition: transform .35s ease; }
.service-card:hover .card-icon,
.service-card:focus-visible .card-icon { background: var(--accent); color: #FFFFFF; }
.service-card:hover .card-icon svg,
.service-card:focus-visible .card-icon svg { transform: rotate(-10deg); }

/* "What's included" list, lined up at the bottom of each card */
.service-included {
  margin-top: auto;
  padding-top: 1.25rem;
}
.service-included-title {
  margin: 0 0 .6rem !important;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.service-included ul { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.service-included li { display: flex; align-items: flex-start; gap: .5rem; font-size: .9rem; line-height: 1.45; }
.service-included li svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: .1rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Cards fade in and slide up one by one when their section appears */
#services.visible .leaf-card {
  animation: leaf-in .5s ease backwards;
  animation-delay: calc(var(--i, 0) * 120ms + 150ms);
}
@keyframes leaf-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #services.visible .leaf-card { animation: none; }
  .leaf-card:hover, .leaf-card:focus-visible, .leaf-card:focus-within { transform: none; }
  .service-card:hover .card-icon svg, .service-card:focus-visible .card-icon svg { transform: none; }
}
/* Services: How I Work (three steps joined by a thin line) */
.how-work { margin-top: 3rem; }
.how-work h3 { margin: 0 0 1.5rem; }
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.how-step { position: relative; }
.how-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: .9rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  font-family: var(--font-heading);
  color: var(--accent);
}
.how-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 48px;
  right: -1rem;
  height: 1px;
  background: #D6D6CC;
}
.how-step h4 { margin: 0 0 .4rem; font-size: 1rem; }
.how-step p { margin: 0; font-size: .95rem; color: var(--muted); }

#services.visible .how-step {
  animation: leaf-in .5s ease backwards;
  animation-delay: calc(var(--i, 0) * 120ms + 150ms);
}
@media (prefers-reduced-motion: reduce) {
  #services.visible .how-step { animation: none; }
}

/* Phones: the steps stack, with the line running down between the numbers */
@media (max-width: 720px) {
  .how-steps { grid-template-columns: 1fr; }
  .how-step { padding-left: 56px; }
  .how-num { position: absolute; top: 0; left: 0; margin: 0; }
  .how-step:not(:last-child)::after {
    top: 44px;
    bottom: -1.25rem;
    left: 20px;
    right: auto;
    width: 1px;
    height: auto;
  }
}

.section-cta { margin-top: 2.5rem; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.tags li {
  padding: .15rem .65rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
}


/* ===== Contact ===== */
.contact-wrap { max-width: 520px; margin: 0 auto; }
.contact-wrap h2, .contact-wrap .lead { text-align: center; }
.contact-wrap .lead { margin: 0 auto; }

.contact-form { display: grid; gap: 1.25rem; margin-top: 2.5rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 500; font-size: .95rem; }
.field-error { font-size: .85rem; color: #B3261E; }
.field-error:empty { display: none; }
.botcheck { display: none; }
.contact-form input, .contact-form textarea {
  font: inherit;
  padding: .75rem .9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.contact-form .invalid { border-color: #B3261E; }
.contact-form button { width: 100%; }
.contact-form button:disabled { opacity: .7; cursor: wait; transform: none; }

/* Send button: paper plane flies off on hover.
   From Uiverse.io by adamgiebl, adapted to the Forest Green theme:
   green instead of royal blue, full width, and the label fades as it slides away
   (on a wide button it would otherwise stay visible). */
.send-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  background: var(--accent);
  color: #FFFFFF;
  padding: 0.8em 1em;
  padding-left: 0.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}

.send-btn .send-label {
  display: block;
  margin-left: 0.4em;
  transition: all 0.3s ease-in-out;
}

.send-btn svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
}

.send-btn .svg-wrapper-1,
.send-btn .svg-wrapper { display: block; }

.send-btn:hover:not(:disabled) { background: #244A40; }

.send-btn:hover:not(:disabled) .svg-wrapper {
  animation: fly-1 0.6s ease-in-out infinite alternate;
}

.send-btn:hover:not(:disabled) svg {
  transform: translateX(1.2em) rotate(45deg) scale(1.1);
}

.send-btn:hover:not(:disabled) .send-label {
  transform: translateX(5em);
  opacity: 0;
}

.send-btn:active:not(:disabled) { transform: scale(0.95); }

.send-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@keyframes fly-1 {
  from { transform: translateY(0.1em); }
  to { transform: translateY(-0.1em); }
}

@media (prefers-reduced-motion: reduce) {
  .send-btn:hover:not(:disabled) .svg-wrapper { animation: none; }
  .send-btn:hover:not(:disabled) svg { transform: none; }
  .send-btn:hover:not(:disabled) .send-label { transform: none; opacity: 1; }
}
.form-status { margin: 0; text-align: center; }
.form-status:empty { display: none; }
.form-status.error { color: #B3261E; }
.form-status.success { color: var(--accent); font-weight: 500; }

/* ===== Interactive form fields ===== */
.field-control { position: relative; }

.field-control input,
.field-control textarea {
  display: block;
  width: 100%;
  padding: 1.45rem 2.75rem .55rem 2.9rem;  /* room for the icon, floating label and tick */
  border: 1px solid #D6D6CC;
  border-radius: 14px 3px 14px 3px;        /* small leaf, like the cards */
  background: #FFFFFF;
  color: var(--text);
  font: inherit;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.field-control textarea { min-height: 150px; padding-top: 1.7rem; resize: vertical; }

.field-control input:hover,
.field-control textarea:hover { border-color: #BFC4B9; }

.field-control input:focus,
.field-control textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 93, 80, .12);
}

/* Browser autofill: keep the white background */
.field-control input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #FFFFFF inset; }

/* Placeholder hint only shows once the label has floated up */
.field-control input::placeholder,
.field-control textarea::placeholder { color: transparent; transition: color .25s ease; }
.field-control input:focus::placeholder,
.field-control textarea:focus::placeholder { color: #A3ABA5; }

/* Floating label: sits inside the box, then floats up and shrinks */
.field-control label {
  position: absolute;
  top: 1.05rem;
  left: 2.9rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  pointer-events: none;
  transform-origin: left top;
  transition: transform .25s ease, color .25s ease;
}
.field-control input:focus + label,
.field-control input:not(:placeholder-shown) + label,
.field-control textarea:focus + label,
.field-control textarea:not(:placeholder-shown) + label {
  transform: translateY(-.7rem) scale(.78);
}
.field-control input:focus + label,
.field-control textarea:focus + label { color: var(--accent); }

/* Icon on the left turns green while typing */
.field-icon,
.field-check {
  position: absolute;
  top: 1.05rem;
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.field-icon { left: .95rem; stroke: #A3ABA5; transition: stroke .25s ease, transform .25s ease; }
.field-control:focus-within .field-icon { stroke: var(--accent); transform: scale(1.08); }

/* Tick on the right pops in once the entry is valid */
.field-check {
  right: .95rem;
  stroke: var(--accent);
  stroke-width: 2.2;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .25s ease, transform .25s ease;
}
.field.is-valid .field-check { opacity: 1; transform: none; }
.field.is-valid input,
.field.is-valid textarea { border-color: rgba(47, 93, 80, .45); }

/* Errors: red border and a short shake when sending with a problem */
.field-control .invalid,
.field-control .invalid:hover { border-color: #B3261E; }
.field-control .invalid:focus { border-color: #B3261E; box-shadow: 0 0 0 4px rgba(179, 38, 30, .12); }
.field-control .invalid + label { color: #B3261E; }
.field-control:has(.invalid) .field-icon { stroke: #B3261E; }
.field.shake .field-control { animation: field-shake .4s ease; }
@keyframes field-shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Message footer: error on the left, character count on the right */
.field-footer { display: flex; justify-content: space-between; gap: 1rem; }
.char-count {
  margin-left: auto;
  font-size: .78rem;
  color: #A3ABA5;
  transition: color .25s ease;
}
.char-count.has-text { color: var(--muted); }
.char-count.near-limit { color: #B3261E; }

@media (prefers-reduced-motion: reduce) {
  .field.shake .field-control { animation: none; }
  .field-control:focus-within .field-icon { transform: none; }
}

/* Thin line with "OR" in the middle */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 2.5rem;
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .12em;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-label { text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }

/* ===== Cycling route (social links) ===== */
.route {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
}

.route-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.route-line path {
  fill: none;
  stroke: #5F6B63;
  stroke-width: 2;
  stroke-dasharray: 6 8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.route-stops { list-style: none; margin: 0; padding: 0; }

/* Each stop is centred on its point on the line (left/top set by script.js) */
.stop {
  position: absolute;
  z-index: 2;
  width: 46px;
  height: 46px;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid #5F6B63;
  color: #1A1A1A;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
.stop svg { width: 20px; height: 20px; }
.stop .icon-fill { fill: currentColor; }
.stop .icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stop.active { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.stop:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Signpost label above the stop (the bike parks in between) */
.signpost {
  position: absolute;
  bottom: calc(100% + 44px);
  left: 50%;
  translate: -50% 0;
  padding: .25rem .7rem;
  border: 1px solid #D6D6CC;
  border-radius: 6px;
  background: var(--surface);
  color: #1A1A1A;
  font-size: .8rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
}
.stop.active .signpost { opacity: 1; transform: none; }

/* The bike sits just above the line, so at a stop it parks on top of the circle */
.route-bike {
  position: absolute;
  z-index: 1;
  width: 34px;
  height: 34px;
  translate: -50% calc(-100% - 22px);
  pointer-events: none;
}
.route-bike svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.route-bike.facing-left svg { transform: scaleX(-1); }

/* Vertical route on small screens: bike on the left, signpost on the right */
.route.vertical { width: min(300px, 100%); }
.route.vertical .route-bike { translate: calc(-100% - 28px) -50%; }
.route.vertical .signpost {
  bottom: auto;
  top: 50%;
  left: calc(100% + 12px);
  translate: 0 -50%;
  transform: translateX(-6px);
}
.route.vertical .stop.active .signpost { transform: none; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: .9rem;
}
.footer p { margin: 0; }
.footer-links { margin-top: .4rem !important; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-links span { margin: 0 .4rem; }

/* ===== Responsive (mobile) ===== */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav nav { position: static; margin-left: 0; }   /* so the open menu is as wide as the whole bar */

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .9rem 1.25rem; }

  /* Hamburger menu: no sliding pill or underline, just a simple active style */
  .nav-pill, .nav-underline { display: none; }
  .nav-links a.active {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
  }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ===== Mono accents (JetBrains Mono) =====
   A small "developer" touch on labels, numbers and tags.
   To revert: delete this whole block and the JetBrains Mono <link> in index.html. */
:root { --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace; }

.eyebrow,
.next-label,
.leaf-num,
.tags li,
.service-included-title,
.inspect-category,
.char-count {
  font-family: var(--font-mono);
}
.eyebrow { font-size: .85rem; letter-spacing: .04em; }
.leaf-num { font-size: 40px; font-weight: 400; }
.next-label { letter-spacing: .14em; }

/* ===== Growing vine scroll progress (vine.js) =====
   Shown on wide screens only, where there is free space on the left. */
.vine {
  position: fixed;
  top: 0;
  left: 8px;
  z-index: 5;
  display: none;
  width: 44px;
  height: 100vh;
  overflow: visible;
  pointer-events: none;
}
@media (min-width: 1180px) { .vine { display: block; } }

.vine-guide { fill: none; stroke: #D6D6CC; stroke-width: 1; stroke-dasharray: 2 5; stroke-linecap: round; }
.vine-stem { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; opacity: .75; }

.vine-leaf {
  fill: rgba(47, 93, 80, .18);
  stroke: var(--accent);
  stroke-width: 1.1;
  transform: scale(0);
  transform-origin: 0 0;
  transition: transform .5s cubic-bezier(.3, 1.4, .5, 1);
}
.vine-leaf.grown { transform: scale(1); }

.vine-bloom { transform: scale(0); transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.vine-flower.grown .vine-bloom { transform: scale(1); }
.vine-bloom ellipse { fill: rgba(143, 179, 163, .55); stroke: var(--accent); stroke-width: .9; }
.vine-bloom-center { fill: var(--accent); }

/* ===== Project tree (tree.js) ===== */
.ptree-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ptree {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin-block: auto;     /* keeps the bud in the middle of the section */
  margin-inline: auto;
}

.ptree-stage {
  position: relative;
  width: min(560px, 100%);
  margin-inline: auto;
  transition: height .6s ease, transform .4s ease;
}
.ptree:not(.is-grown) .ptree-stage { overflow: hidden; }

.ptree-svg {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

/* Lines draw themselves with a dash that slides away */
.ptree-draw {
  fill: none;
  stroke: #2F5D50;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset .6s ease-in, opacity 0s linear .6s;
}
.is-grown .ptree-draw {
  stroke-dashoffset: 0;
  opacity: 1;
  transition: stroke-dashoffset var(--t) ease-out var(--d), opacity 0s linear var(--d);
}

.ptree-leaf {
  fill: #8FB3A3;
  transform: scale(0);
  transform-origin: 0 0;
  transition: transform .25s ease;
}
.is-grown .ptree-leaf {
  transform: scale(1);
  transition: transform .3s cubic-bezier(.3, 1.5, .5, 1) var(--d);
}

/* The flower: a closed bud that gently pulses, then its petals unfold */
.ptree-flower {
  transform-origin: 0 0;
  animation: ptree-pulse 2.4s ease-in-out infinite;
}
.is-bloomed .ptree-flower { animation: none; }
@keyframes ptree-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.ptree-petal {
  fill: #F5F5F0;
  stroke: #2F5D50;
  stroke-width: 1.5;
  stroke-linejoin: round;
  transform: rotate(var(--closed)) scaleX(.62);
  transform-origin: 0 0;
  transition: transform .8s cubic-bezier(.3, .9, .4, 1);
}
.is-bloomed .ptree-petal { transform: rotate(var(--open)) scaleX(1); }

.ptree-sepal {
  fill: none;
  stroke: #2F5D50;
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: opacity .4s ease;
}
.is-bloomed .ptree-sepal { opacity: 0; }

.ptree-heart {
  fill: #8FB3A3;
  stroke: #2F5D50;
  stroke-width: 1.5;
  transform: scale(0);
  transform-origin: 0 0;
  transition: transform .4s ease;
}
.is-bloomed .ptree-heart { transform: scale(1); transition-delay: .4s; }

/* Invisible button over the bud */
.ptree-bud {
  position: absolute;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.ptree-bud:hover { background: rgba(47, 93, 80, .05); }
.ptree-bud:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }

.ptree-hint {
  position: absolute;
  top: 112px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: .9rem;
  color: #5F6B63;
  transition: opacity .3s ease;
}
.is-bloomed .ptree-hint { opacity: 0; }

/* Fruit at the end of each branch */
.ptree-node {
  position: absolute;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  transform: scale(0);
  visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s;
}
.is-fruit .ptree-node {
  transform: scale(1);
  visibility: visible;
  transition: transform .35s cubic-bezier(.3, 1.7, .5, 1) var(--pop), visibility 0s linear var(--pop);
}
button.ptree-node { cursor: pointer; }

.ptree-fruit {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 2px solid #2F5D50;
  border-radius: 50%;
  background: #FFFFFF;
  color: #2F5D50;
  transition: transform .25s ease, background-color .25s ease, color .25s ease;
}
.ptree-fruit img { width: 100%; height: 100%; object-fit: cover; }
.ptree-fruit svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button.ptree-node:hover .ptree-fruit,
button.ptree-node:focus-visible .ptree-fruit,
button.ptree-node.is-active .ptree-fruit {
  transform: scale(1.14);
  background: #2F5D50;
  color: #FFFFFF;
}
button.ptree-node:focus { outline: none; }
button.ptree-node:focus-visible .ptree-fruit { outline: 2px solid #2F5D50; outline-offset: 3px; }

/* Names are always visible, under the fruit (phones, tablets, touch screens) */
.ptree-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  width: 116px;
  margin-left: -58px;
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  color: var(--text);
}

/* The "Growing..." branch comes in under the bud, so its name goes on top */
.ptree-growing .ptree-label { top: auto; bottom: calc(100% + 2px); }

/* With a mouse on a big screen, the name appears next to the fruit on hover or focus */
@media (min-width: 1024px) and (hover: hover) {
  .ptree-label {
    top: 50%;
    width: max-content;
    margin: 0;
    transform: translateY(-50%);
    transition: opacity .2s ease;
  }
  .ptree-node.left .ptree-label { left: auto; right: calc(100% + 12px); }
  .ptree-node.right .ptree-label { left: calc(100% + 12px); }
  .ptree-growing .ptree-label { top: 50%; bottom: auto; }
  button.ptree-node .ptree-label { opacity: 0; }
  button.ptree-node:hover .ptree-label,
  button.ptree-node:focus-visible .ptree-label,
  button.ptree-node.is-active .ptree-label { opacity: 1; }
  /* The card is open beside the tree: names go above the fruit, clear of the card and the leaves */
  .ptree.has-card .ptree-node .ptree-label {
    top: auto;
    bottom: calc(100% + 8px);
    left: 50%;
    right: auto;
    width: 116px;
    margin-left: -58px;
    transform: none;
  }
}

/* "Growing..." bud: not clickable */
.ptree-small-bud {
  display: block;
  width: 100%;
  height: 100%;
  fill: #F5F5F0;
  stroke: #2F5D50;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ptree-growing .ptree-label { color: #5F6B63; font-weight: 400; font-style: italic; }

.ptree-replay {
  position: absolute;
  left: 50%;
  padding: .25rem .5rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: .85rem;
  color: #5F6B63;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: color .2s ease, opacity .3s ease;
}
.is-done .ptree-replay { opacity: 1; visibility: visible; }
.ptree-replay:hover { color: var(--accent); }
.ptree-replay:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Detail card */
.ptree-card {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 5;
  width: 380px;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #D6D6CC;
  border-radius: 28px 4px 28px 4px;
  box-shadow: 0 12px 28px rgba(26, 26, 26, .08);
  animation: ptree-card-in .3s ease;
}
.ptree-card[hidden], .ptree-scrim[hidden] { display: none; }
@keyframes ptree-card-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}
.ptree-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #ECECE5;
  border-bottom: 1px solid var(--border);
}
.ptree-card-body { padding: 1.25rem 1.5rem 1.5rem; }
.ptree-card-body h3 { margin: 0 0 .5rem; }
.ptree-card-text { margin: 0 0 1rem; color: var(--muted); }
.ptree-card-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.ptree-card-close {
  position: absolute;
  top: .6rem;
  right: .6rem;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--text);
  cursor: pointer;
}
.ptree-card-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ptree-card-close:hover { color: var(--accent); border-color: var(--accent); }
.ptree-card-close:focus { outline: none; }
.ptree-card-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Big screens: the tree steps left to make room for the card beside it */
@media (min-width: 1024px) {
  .ptree.has-card .ptree-stage { transform: translateX(calc(var(--shift, 0px) * -1)); }
  /* A fruit on the left opens its card on the left, and the tree steps right instead */
  .ptree.has-card.card-left .ptree-stage { transform: translateX(var(--shift, 0px)); }
  .ptree.card-left .ptree-card { left: 0; right: auto; animation-name: ptree-card-in-left; }
  @keyframes ptree-card-in-left {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: none; }
  }
  .ptree-scrim { display: none; }
}

/* Phones and tablets: the card is a bottom sheet */
@media (max-width: 1023px) {
  .ptree-scrim {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(26, 26, 26, .35);
  }
  .ptree-card {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 111;
    width: auto;
    max-width: 560px;
    max-height: 85vh;
    max-height: 85svh;
    margin-inline: auto;
    overflow-y: auto;
    border-width: 1px 1px 0;
    border-radius: 28px 28px 0 0;
    animation-name: ptree-sheet-in;
  }
  @keyframes ptree-sheet-in {
    from { transform: translateY(100%); }
    to { transform: none; }
  }
}

/* Reduce motion: the tree is already grown, nothing moves */
@media (prefers-reduced-motion: reduce) {
  .ptree-stage, .ptree-draw, .ptree-leaf, .ptree-petal, .ptree-sepal, .ptree-heart,
  .ptree-node, .ptree-fruit, .ptree-hint, .ptree-replay { transition: none !important; }
  .ptree-flower, .ptree-card { animation: none; }
  .ptree-replay { display: none; }
}

/* ===== Intro animation (intro.js) ===== */
.intro-screen { display: none; }
html.intro .intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #F5F5F0;
  transition: opacity .5s ease;
  /* Safety net: never stay longer than 4s, even if the script does not run */
  animation: intro-safety 0s linear 4s forwards;
}
.intro-screen svg { width: min(620px, 86vw); overflow: visible; }
.intro-screen text {
  font-family: var(--font-heading);
  font-size: 88px;
  font-weight: 500;
  letter-spacing: .08em;
  fill: transparent;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 1000;   /* longer than any letter's outline, so each letter draws fully */
  stroke-dashoffset: 1000;
}
.intro-screen.play text { animation: intro-draw 1s ease forwards, intro-fill .45s ease .95s forwards; }
.intro-screen.done { opacity: 0; pointer-events: none; }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
@keyframes intro-fill { to { fill: var(--accent); stroke-width: 0; } }
@keyframes intro-safety { to { visibility: hidden; } }

/* ===== Status badge (Home panel) ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1.1rem;
  padding: .3rem .8rem .3rem .65rem;
  border: 1px solid rgba(47, 93, 80, .22);
  border-radius: 999px;
  background: rgba(47, 93, 80, .07);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 500;
}
.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3E8E6E;
}
/* Soft pulse ring around the dot */
.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #3E8E6E;
  animation: status-pulse 2s ease-out infinite;
}
@keyframes status-pulse {
  from { transform: scale(1); opacity: .5; }
  to { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot::after { animation: none; }
}

/* ===== Desktop "one section at a time" mode (navigation.js adds .paged on <html>) =====
   Only the current section is shown. If no section is marked current yet,
   everything stays visible, so the page never goes blank. */
html.paged { scroll-snap-type: none; }
html.paged main:has(> section.is-current) > section:not(.is-current) { display: none; }
/* The footer only appears with the last section (Contact) */
html.paged .footer { display: none; }
html.paged.on-last .footer { display: block; }

/* ===== Extra effects (effects.js) =====
   Each numbered block matches a block in effects.js. Delete both to remove an effect. */

/* 1. Headings: each word rises out of a thin mask */
.split-heading .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: .1em;
  margin-bottom: -.1em;
}
.split-heading .word > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--w, 0) * 70ms);
}
.split-heading.in .word > span { transform: none; }

/* 2. About: paragraphs fade up one after another */
.about-text[data-reveal] > p {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.about-text.in > p { opacity: 1; transform: none; }
.about-text.in > p:nth-child(2) { transition-delay: .08s; }
.about-text.in > p:nth-child(3) { transition-delay: .16s; }
.about-text.in > p:nth-child(4) { transition-delay: .24s; }

/* 3. About: quick facts with counting numbers */
.about-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid #D6D6CC;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease .3s, transform .5s ease .3s;
}
.about-facts.in { opacity: 1; transform: none; }
.about-facts div { display: flex; flex-direction: column-reverse; gap: .2rem; }
.about-facts dd {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.about-facts dt {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.35;
}
@media (max-width: 560px) {
  .about-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.3rem; }
}

/* Sticky: on big screens the photo stack stays in view while the text scrolls past */
@media (min-width: 1024px) {
  .polaroids { position: sticky; top: calc(var(--nav-h) + 2rem); }
}

/* 4. Services: slow marquee between two thin lines */
.ticker {
  overflow: hidden;
  margin: -.25rem 0 2.25rem;
  padding: .85rem 0;
  border-top: 1px solid #D6D6CC;
  border-bottom: 1px solid #D6D6CC;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: ticker 45s linear infinite;
  animation-play-state: paused;
}
.ticker.is-running .ticker-track { animation-play-state: running; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker span {
  margin-right: 1.5rem;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--accent);
  white-space: nowrap;
}
.ticker i {
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 1.5rem;
  border-radius: 0 100% 0 100%;
  background: #8FB3A3;
  transform: rotate(-45deg);
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* 5. Service icons and ticks draw themselves */
.service-card .card-icon svg * { stroke-dasharray: 1; stroke-dashoffset: 0; }
.service-card:hover .card-icon svg *,
.service-card:focus-visible .card-icon svg * { animation: line-draw .7s ease both; }
.service-included li svg path { stroke-dasharray: 1; }
#services.visible .service-included li svg path {
  animation: line-draw .45s ease backwards;
  animation-delay: calc(var(--i, 0) * 120ms + 550ms);
}
#services.visible .service-included li:nth-child(2) svg path { animation-delay: calc(var(--i, 0) * 120ms + 650ms); }
#services.visible .service-included li:nth-child(3) svg path { animation-delay: calc(var(--i, 0) * 120ms + 750ms); }
@keyframes line-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* Soft green light that follows the pointer across a tilted service card */
html.has-cursor .service-card:hover {
  background-image: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(143, 179, 163, .16), transparent 55%);
}
.service-card { will-change: transform; }

/* 6. How I Work: a green line fills between the steps as you scroll */
.how-num { z-index: 2; transition: background-color .3s ease, color .3s ease; }
.how-step.lit .how-num { background: var(--accent); color: #FFFFFF; }
.how-step:not(:last-child)::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 20px;
  left: 48px;
  right: -1rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(var(--fill, 0));
  transform-origin: left;
}
@media (max-width: 720px) {
  .how-step:not(:last-child)::before {
    top: 44px;
    bottom: -1.25rem;
    left: 20px;
    right: auto;
    width: 1px;
    height: auto;
    transform: scaleY(var(--fill, 0));
    transform-origin: top;
  }
}

/* 8. Home: layers inside the panel ease toward the pointer */
.beam-content [data-depth] { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }

/* 10. Custom cursor (mouse only) */
.cursor-dot,
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s ease;
}
html.cursor-on .cursor-dot,
html.cursor-on .cursor-ring { opacity: 1; }
html.cursor-text .cursor-dot,
html.cursor-text .cursor-ring { opacity: 0; }
.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent);
}
.cursor-ring {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1.5px solid rgba(47, 93, 80, .5);
  transition: opacity .3s ease, width .3s ease, height .3s ease, margin .3s ease, background-color .3s ease, border-color .3s ease;
}
.cursor-ring.is-hover {
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-color: var(--accent);
  background: rgba(47, 93, 80, .08);
}
.cursor-ring.is-down { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
html.has-cursor.cursor-on body,
html.has-cursor.cursor-on body *:not(input):not(textarea):not(select) { cursor: none; }

@media (prefers-reduced-motion: reduce) {
  .split-heading .word > span,
  .about-text[data-reveal] > p,
  .about-facts { opacity: 1; transform: none; }
  .ticker-track { animation: none; }
  .service-card .card-icon svg *,
  #services.visible .service-included li svg path { animation: none; }
}

/* ===== Service prices ("From RM...") ===== */
.service-price {
  margin: 1.1rem 0 0 !important;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent) !important;
  white-space: nowrap;
}
.service-price span {
  margin-right: .3rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}
.price-note {
  margin: 1.1rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}

/* ===== Home: clearer offer, main button, trust line, latest project (2026-11-20) ===== */
.hero h1 { max-width: none; }
.hero h1 .h1-top {
  display: block;
  margin-bottom: .35rem;
  font-size: .5em;
  line-height: 1.25;
  color: var(--text);
}
.hero h1 > span:last-child { display: block; }

/* "Hire Me" is the main button: filled green, darker green sweeps in on hover */
.sweep-btn.is-solid { background: var(--accent); color: #FFFFFF; }
.sweep-btn.is-solid::before { background-color: #1F3D35; }

/* Trust line under the buttons */
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.4rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .88rem;
  color: var(--muted);
}
.hero-trust li { display: flex; align-items: center; gap: .5rem; }
.hero-trust li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 0 100% 0 100%;
  background: #8FB3A3;
  transform: rotate(-45deg);
}

/* Latest project: a small browser window with the MyPocket preview */
.hero-work {
  display: block;
  margin-top: 2.25rem;
  color: inherit;
  text-decoration: none;
}
.hero-work-frame {
  display: block;
  overflow: hidden;
  border: 1px solid #D6D6CC;
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 0 18px 40px -22px rgba(31, 61, 53, .45);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s ease, border-color .45s ease;
}
.hero-work-bar {
  display: flex;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid #ECECE4;
  background: #FBFBF8;
}
.hero-work-bar i { width: 8px; height: 8px; border-radius: 50%; background: #D6D6CC; }
.hero-work img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-work-caption {
  display: grid;
  gap: .1rem;
  margin-top: .9rem;
  font-size: .9rem;
  color: var(--muted);
}
.hero-work-caption strong {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text);
}
.hero-work-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-work:hover .hero-work-frame,
.hero-work:focus-visible .hero-work-frame {
  transform: translateY(-4px) rotate(-.6deg);
  border-color: rgba(47, 93, 80, .45);
  box-shadow: 0 26px 50px -24px rgba(31, 61, 53, .55);
}
.hero-work:focus-visible { outline: none; }
.hero-work:focus-visible .hero-work-frame { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Wide screens: text on the left, the project on the right */
@media (min-width: 960px) {
  .hero-inner .beam-panel { max-width: 1040px; }
  .beam-content {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 2.75rem;
    align-items: center;
  }
  .hero-work { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-work:hover .hero-work-frame,
  .hero-work:focus-visible .hero-work-frame { transform: none; }
}

/* ===== Services: common questions ===== */
.service-faq { margin-top: 3rem; max-width: 760px; }
.service-faq h3 { margin: 0 0 1rem; }
.service-faq details { border-bottom: 1px solid #D6D6CC; }
.service-faq details:first-of-type { border-top: 1px solid #D6D6CC; }
.service-faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 52px;
  padding: .6rem 0;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  transition: color .3s ease;
}
.service-faq summary::-webkit-details-marker { display: none; }
.service-faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .3s ease;
}
.service-faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.service-faq summary:hover,
.service-faq summary:focus-visible { color: var(--accent); }
.service-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.service-faq details p { margin: 0 0 1rem; color: var(--muted); max-width: 62ch; }

/* ===== Contact: reply time and email ===== */
.contact-reply {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  margin: -.25rem 0 1.5rem;
  font-size: .92rem;
  color: var(--accent);
}
.contact-email { margin: 1rem 0 0; font-size: .92rem; color: var(--muted); }
.contact-email a { font-weight: 500; overflow-wrap: anywhere; }
