/* =========================================================
   3vhy — "Turtle Beach"
   Sand, sea and turtle-shell greens. Pixel everything.
   ========================================================= */

@font-face { font-family: "Pixelify Sans"; src: url("fonts/PixelifySans.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Monocraft"; src: url("fonts/Monocraft-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Monocraft"; src: url("fonts/Monocraft-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --sand: #efe3b8;
  --sand-dark: #dccb92;
  --paper: #fbf5e1;
  --shell: #3f6b34;
  --scute: #6a9a45;
  --turtle: #9cc46b;
  --sea: #3e9db0;
  --sea-deep: #22647a;
  --egg: #f3eed7;
  --wood: #8b5a2b;
  --ink: #1d2b22;
  --muted: #5d5a44;
  /* icon palette (icons.js) */
  --accent: var(--turtle);
  --accent-2: var(--scute);
  --font-head: "Pixelify Sans", ui-monospace, monospace;
  --font-body: "Monocraft", ui-monospace, monospace;
  --body-size: 16px;
  --sand-tex: none;
  --shell-tex: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  color: var(--ink);
  background-color: var(--sand);
  background-image: var(--sand-tex);
  background-size: 64px 64px;
  font-family: var(--font-body); font-size: var(--body-size); line-height: 1.6;
  font-variant-ligatures: none;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sea-deep); outline-offset: 3px; }
.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.pixelated { image-rendering: pixelated; }

/* icon palette */
.pk { fill: var(--ink); } .pa { fill: var(--accent); } .pd { fill: var(--accent-2); }
.pw { fill: #fff; } .py { fill: #e9c46a; } .po { fill: #b8913a; } .pr { fill: #d96c75; }
.pg { fill: #b9c0c8; } .pb { fill: var(--wood); } .ps { fill: #f0d9cc; }
.pe { fill: var(--egg); } .pc { fill: color-mix(in srgb, var(--sea) 55%, white); }
.px-icon { display: block; }

/* ---------- shared controls (also used by the dashboard) ---------- */
.mc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 8px 22px;
  font-family: var(--font-head); font-size: 19px; font-weight: 600; line-height: 1.1;
  color: var(--paper); text-decoration: none; cursor: pointer;
  background: var(--shell);
  border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .2), inset 0 -4px 0 rgba(0, 0, 0, .25);
}
.mc-btn:hover { background: var(--scute); }
.mc-btn:active { box-shadow: inset 0 4px 0 rgba(0, 0, 0, .25); }
.mc-btn.alt { color: var(--paper); background: var(--sea-deep); }
.mc-btn.alt:hover { background: var(--sea); }
.mc-btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip-btn {
  font-family: var(--font-body); font-size: 13px; line-height: 1;
  min-height: 30px; padding: 6px 10px; cursor: pointer;
  color: var(--ink); background: var(--paper); border: 2px solid var(--ink);
}
.chip-btn:hover { background: #fff; }
.slot { flex: none; display: grid; place-items: center; background: rgba(29, 43, 34, .08); border: 3px solid var(--ink); }
.panel { background: var(--paper); border: 3px solid var(--ink); }
.loader { min-height: 100vh; display: grid; place-items: center; font-family: var(--font-head); font-size: 22px; }
.toast {
  position: fixed; left: 50%; bottom: 52px; z-index: 100; max-width: calc(100% - 32px);
  padding: 8px 14px; color: var(--paper); background: var(--ink); border: 3px solid var(--ink);
  transform: translate(-50%, 220%); visibility: hidden; transition: transform .18s, visibility .18s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast b { color: var(--turtle); font-weight: 400; }

/* =========================================================
   Top bar
   ========================================================= */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 22px; text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 15px; padding: 2px 4px; }
.nav a svg { width: 16px; height: 16px; }
.nav a:hover { background: var(--ink); color: var(--paper); }

/* =========================================================
   Hero
   ========================================================= */
.hero { padding: 44px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 448px); gap: 52px; align-items: center; }
.title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(96px, 17vw, 210px); line-height: .82; letter-spacing: -.02em;
  color: var(--shell); text-shadow: .04em .04em 0 var(--ink);
  word-break: break-word;
}
.status { display: inline-flex; align-items: center; gap: 10px; margin-top: 40px; padding: 6px 12px; background: var(--paper); border: 3px solid var(--ink); font-size: 15px; }
.status svg { width: 18px; height: 18px; }
.tagline { margin-top: 22px; max-width: 30ch; font-family: var(--font-head); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.handle { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.handle b { color: var(--ink); font-weight: 700; }
.handle button { margin-left: 4px; }

.stats { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 48px; }
.stat { display: flex; align-items: center; gap: 10px; }
.stat svg { width: 40px; height: 40px; }
.stat b { font-family: var(--font-head); font-size: 36px; line-height: 1; font-weight: 700; }
.stat span { font-size: 14px; color: var(--muted); max-width: 9ch; line-height: 1.3; }

/* the beach scene: a mother turtle by her nest, a hatchling heading out to sea */
.scene { position: relative; width: 100%; aspect-ratio: 1; border: 4px solid var(--ink); box-shadow: 10px 10px 0 rgba(29, 43, 34, .16); background: var(--sand); overflow: hidden; }
.scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .mama { position: absolute; left: 6.25%; top: 39%; width: 43.75%; }
.scene .baby { position: absolute; left: 68%; top: 71%; width: 20%; animation: paddle 3.2s steps(6) infinite; }
.scene .mama svg, .scene .baby svg { width: 100%; height: auto; display: block; }

/* =========================================================
   Sections
   ========================================================= */
.sec { padding: 88px 0 8px; }
.sec-head { display: flex; align-items: center; gap: 18px; margin-bottom: 34px; }
.sec-head > svg { width: 52px; height: 52px; flex: none; }
.sec-head h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(40px, 6vw, 66px); line-height: 1; }
.sec-head p { margin-top: 8px; color: var(--muted); max-width: 52ch; }

.about p { max-width: 62ch; font-size: calc(var(--body-size) + 1px); margin-bottom: 14px; }
.about p:first-child { font-family: var(--font-head); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.35; max-width: 40ch; }
.about strong { font-weight: 700; background: linear-gradient(transparent 58%, color-mix(in srgb, var(--turtle) 70%, transparent) 58%); }

.sub { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-head); font-size: 26px; font-weight: 600; margin: 0 0 18px; }
.sub small { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--muted); }

/* Current roles — shell cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; margin-bottom: 64px; }
.card { background: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 rgba(29, 43, 34, .16); }
.card-shell { height: 46px; background-color: var(--shell); background-image: var(--shell-tex); background-size: 48px 48px; image-rendering: pixelated; border-bottom: 3px solid var(--ink); }
.card-body { position: relative; padding: 16px 20px 18px; }
.card-body > .px-icon { position: absolute; top: -26px; right: 16px; width: 44px; height: 44px; padding: 4px; background: var(--paper); border: 3px solid var(--ink); box-sizing: content-box; }
.card-body > img { position: absolute; top: -26px; right: 16px; width: 44px; height: 44px; border: 3px solid var(--ink); }
.card h3 { font-family: var(--font-head); font-weight: 700; font-size: 34px; line-height: 1; padding-right: 60px; }
.card .at { margin-top: 6px; font-size: 15px; }
.card .at b { font-weight: 700; }
.card .desc { margin-top: 12px; font-size: 14px; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 13px; }
.tag { padding: 2px 8px; border: 2px solid var(--ink); background: var(--sand); }
.tag.now { color: var(--paper); background: var(--sea-deep); }
.addr { font: inherit; font-size: 13px; cursor: pointer; padding: 2px 8px; border: 2px dashed var(--ink); background: transparent; }
.addr:hover { background: var(--paper); }

/* Past roles — the nest of eggs */
.nest { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; padding: 20px; background: var(--sand-dark); border: 3px solid var(--ink); box-shadow: inset 0 6px 0 rgba(29, 43, 34, .08); }
.egg { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--paper); border: 2px solid var(--ink); }
.egg > svg { width: 40px; height: 40px; flex: none; }
.egg > div { min-width: 0; }
.egg .r { display: block; font-weight: 700; line-height: 1.25; }
.egg .s { display: block; font-size: 14px; color: var(--muted); line-height: 1.35; }
.egg .tag, .egg .addr { display: inline-block; margin-top: 6px; font-size: 12px; }

/* Skills — scute pips */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0; border: 3px solid var(--ink); background: var(--paper); }
.skill { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px 20px; border-bottom: 2px solid rgba(29, 43, 34, .12); border-right: 2px solid rgba(29, 43, 34, .12); }
.skill > svg { width: 40px; height: 40px; }
.skill h3 { font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1.15; }
.scutes { display: flex; gap: 2px; margin-top: 8px; }
.scutes svg { width: 20px; height: 20px; }
.scutes .off .pa, .scutes .off .pd { fill: rgba(29, 43, 34, .12); }
.scutes .off .pk { fill: rgba(29, 43, 34, .25); }
.skill p { margin-top: 6px; font-size: 14px; color: var(--muted); }

/* Contact — message in a bottle, out at sea */
.sea { position: relative; margin-top: 110px; padding: 72px 0 90px; background: var(--sea); color: var(--paper); }
.sea::before {
  content: ""; position: absolute; left: 0; right: 0; top: -24px; height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' shape-rendering='crispEdges'%3E%3Cpath fill='%23ffffff' d='M0 12h12v4H0zM12 8h12v4H12zM24 12h24v4H24z'/%3E%3Cpath fill='%233e9db0' d='M0 16h12v8H0zM12 12h12v12H12zM24 16h24v8H24z'/%3E%3C/svg%3E");
  background-size: 48px 24px; background-repeat: repeat-x;
}
.sea .sec-head h2 { color: var(--paper); text-shadow: 4px 4px 0 var(--sea-deep); }
.sea .sec-head p { color: color-mix(in srgb, var(--paper) 80%, var(--sea)); }
.letter { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 48px; align-items: center; }
.bottle { width: 180px; height: 270px; display: block; animation: bob 3.6s steps(6) infinite; filter: drop-shadow(8px 8px 0 rgba(0, 0, 0, .15)); }
.letter-text p { max-width: 42ch; font-size: calc(var(--body-size) + 1px); }
.to { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 10px 14px; color: var(--ink); background: var(--paper); border: 3px solid var(--ink); max-width: 420px; }
.to small { font-size: 13px; color: var(--muted); }
.to b { font-family: var(--font-head); font-size: 24px; font-weight: 700; }
.to .chip-btn { margin-left: auto; }
.letter .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sea .mc-btn.alt { background: var(--sea-deep); }

.footer { padding: 22px 0 70px; background: var(--sea-deep); color: color-mix(in srgb, var(--paper) 80%, var(--sea-deep)); font-size: 13px; }

/* =========================================================
   The scroll turtle: walks along the shore as you scroll
   ========================================================= */
.shore { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 34px; pointer-events: none; }
.shore::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: linear-gradient(90deg, var(--sand-dark) 0 92%, var(--sea) 92%); border-top: 2px solid var(--ink); }
.shore .walker { position: absolute; bottom: 6px; left: calc(var(--p, 0) * (100% - 64px)); width: 64px; }
.shore .walker svg { display: block; width: 64px; height: auto; }
.shore.moving .walker svg { animation: waddle .35s steps(2) infinite; }
body.no-walker .shore { display: none; }

@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes paddle { 50% { transform: translate(4%, -3%); } }
@keyframes waddle { 50% { transform: translateY(-2px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .scene { max-width: 420px; }
  .letter { grid-template-columns: 1fr; gap: 28px; }
  .bottle { width: 120px; height: 180px; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav { gap: 4px 14px; }
  .hero { padding-top: 32px; }
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 40px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 6px; }
  .stat svg { width: 34px; height: 34px; }
  .stat b { font-size: 28px; }
  .stat span { font-size: 12px; }
  .sec { padding-top: 64px; }
  .sec-head > svg { width: 40px; height: 40px; }
  .nest { padding: 12px; grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .to b { font-size: 20px; }
  .shore { height: 26px; }
  .shore::before { height: 6px; }
  .shore .walker { width: 44px; bottom: 4px; left: calc(var(--p, 0) * (100% - 44px)); }
  .shore .walker svg { width: 44px; }
}
