/* From the Orange Tree: layout, panels, type, responsive and reduced-motion rules. */
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/AtkinsonHyperlegibleNext.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("fonts/PixelifySans.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #fdf3e0;
  --ink-soft: #e4d8bd;
  --gold: #e7c98a;
  --orange: #ff9f2e;
  --orange-deep: #b5400d;
  --panel-a: rgba(28, 33, 27, .95);
  --panel-b: rgba(17, 20, 18, .96);
  --bark: #4c3022;
  --display: "Pixelify Sans", "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --ui: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 56px;
  --shaft: .95; --moon: 0; --night: 0; --tint: #ffffff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; scroll-padding-bottom: 96px; }
body { margin: 0; background: #0a0c1a; color: var(--ink); font: 17px/1.6 var(--ui); overflow-x: hidden; }
img, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: #ffd98c; text-underline-offset: 3px; }
a:hover { color: #fff1c4; }
:focus-visible { outline: 3px solid #ffe08a; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(0, 0, 0, .75); }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 100; background: #fff3dc; color: #1a1210; padding: 10px 14px; font-weight: 700; }
.skip:focus { top: 8px; }

/* ---- layers ---- */
#sky { position: fixed; left: 0; top: 0; z-index: 0; width: 100vw; height: 100vh; display: block; }
.tint { position: fixed; inset: 0; z-index: 2; background: var(--tint); mix-blend-mode: multiply; pointer-events: none; }
.shafts { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: calc(var(--shaft) * .85); mix-blend-mode: screen;
  background:
    repeating-conic-gradient(from 188deg at 82% -12%, rgba(255, 238, 180, 0) 0deg 3deg, rgba(255, 238, 180, .22) 4deg 6.5deg, rgba(255, 238, 180, 0) 8deg 15deg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .6) 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .6) 55%, transparent 100%);
  animation: shaftSway 14s ease-in-out infinite alternate; }
.moonlight { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: var(--moon); mix-blend-mode: screen;
  background: repeating-conic-gradient(from 170deg at 22% -10%, rgba(150, 175, 255, 0) 0deg 4deg, rgba(150, 175, 255, .14) 5deg 7deg, rgba(150, 175, 255, 0) 8deg 17deg);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 80%); mask-image: linear-gradient(180deg, #000, transparent 80%); }
@keyframes shaftSway { from { transform: translateX(-1.5%) } to { transform: translateX(1.5%) } }

.fx { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 85% 80% at 50% 45%, transparent 55%, rgba(8, 4, 18, .5) 100%); }
.tilt { position: absolute; left: 0; right: 0; }
.tilt.top { top: var(--nav-h); height: 7vh; -webkit-backdrop-filter: blur(2.5px); backdrop-filter: blur(2.5px); -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.tilt.bottom { bottom: 0; height: 9vh; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); -webkit-mask-image: linear-gradient(transparent, #000); mask-image: linear-gradient(transparent, #000); }
#flies { position: fixed; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; opacity: calc(var(--night) * 1); }
/* ---- nav ---- */
.nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 max(12px, 2vw);
  background: rgba(17, 13, 10, .92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 3px solid var(--gold); box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 19px/1 var(--ui); min-height: 44px; }
.brand canvas, .brand img { width: 32px; height: 32px; filter: drop-shadow(0 0 6px rgba(255, 150, 40, .7)); }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--ink); text-decoration: none; font: 600 17px/1 var(--ui); border: 2px solid transparent; }
.nav nav a:hover { border-color: var(--gold); background: rgba(255, 159, 46, .18); }

/* ---- structure ---- */
main { position: relative; padding-top: var(--nav-h); overflow-x: clip; }
.tree-bg, .tree-fg { position: absolute; left: 0; top: 0; pointer-events: none; }
.tree-bg { z-index: 1; }
.tree-fg { z-index: 6; filter: blur(1.8px); opacity: .96; }
.wrap { width: min(960px, calc(100% - 28px)); margin-inline: auto; position: relative; }
.wrap.narrow { width: min(680px, calc(100% - 28px)); }
.canopy, .sec { position: relative; z-index: 3; }
.canopy { z-index: 8; padding-top: clamp(12px, 3vh, 36px); }
.sec { padding-bottom: 0; scroll-margin-top: calc(var(--nav-h) + 4px); }
#top, #resume, #contact { scroll-margin-top: calc(var(--nav-h) + 12px); }

/* ---- panels (dark, high contrast, HD-2D dialogue-window feel) ---- */
.panel { position: relative; background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); padding: 28px clamp(18px, 3vw, 34px); color: var(--ink); }
.panel.hero { background: #12110e; padding: 20px clamp(16px, 3vw, 28px) 16px; }
  box-shadow: 0 -3px 0 0 var(--gold), 0 3px 0 0 var(--gold), -3px 0 0 0 var(--gold), 3px 0 0 0 var(--gold), 0 0 0 6px rgba(8, 6, 4, .85), 0 14px 0 3px rgba(0, 0, 0, .28), 0 0 46px rgba(255, 170, 60, .13); }
.panel h1, .panel h2, .panel h3, .panel h4, .brand, .kicker, .btn, .label, .when { font-family: var(--ui); }
/* Pixel face is for a few big headings only: the name and the section titles (and the arcade marquee). */
h1, .panel h1, .panel h2:not(.mini), .bonus-card h2, .marquee span { font-family: var(--display); letter-spacing: .01em; }
.kicker { margin: 0 0 6px; font: 600 15px/1.2 var(--ui); color: #ffbe66; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 64px); line-height: .98; font-weight: 700; text-shadow: 4px 4px 0 #6b2208; }
h1 span { display: block; color: #ffb347; }
h2 { margin: 0 0 8px; font-size: clamp(27px, 4vw, 38px); line-height: 1.1; font-weight: 700; }
h2.mini { font-size: 22px; color: #ffb347; margin-bottom: 6px; }
h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; font-weight: 600; }
h4 { margin: 0 0 8px; font-size: 18px; color: #ffb347; font-weight: 600; }
p { margin: 0 0 12px; }
.panel p:last-child { margin-bottom: 0; }
.tagline { font: 600 clamp(18px, 2.2vw, 24px)/1.25 var(--ui); margin: 8px 0 6px; color: #fff6e4; }
.hero p { color: #f6f0e6; }
.hero .tagline { color: #fff6e4; }
.tagline span { display: inline-block; }
.lede { font-size: 19px; color: var(--ink-soft); }
.small { font-size: 15px; }
.note { margin-top: 18px; color: var(--ink-soft); }
.tbd { display: inline-block; margin: 4px 0 10px; padding: 4px 9px; border: 2px dashed var(--gold); color: #ffe0a8; font-size: 14px; line-height: 1.4; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; background: var(--orange); color: #1d0e05; border: 0; cursor: pointer; text-decoration: none; font: 700 18px/1 var(--ui);
  box-shadow: 0 -3px 0 0 #ffd27a, 0 3px 0 0 var(--orange-deep), -3px 0 0 0 #ffd27a, 3px 0 0 0 var(--orange-deep), 0 6px 0 3px rgba(0, 0, 0, .35); transition: transform .08s; }
.btn:hover { background: #ffb347; color: #1d0e05; }
.btn:active { transform: translateY(3px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 0 -3px 0 0 var(--gold), 0 3px 0 0 var(--gold), -3px 0 0 0 var(--gold), 3px 0 0 0 var(--gold); }
.btn.ghost:hover { background: rgba(255, 159, 46, .22); color: #fff; }
.btn.disabled { background: #3a342c; color: #d8cdb4; box-shadow: 0 0 0 3px #6d6350; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 4px 2px; color: #ffd98c; font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; text-underline-offset: 3px; min-height: 32px; }

/* ---- hero / canopy ---- */
.hero { max-width: 700px; margin-inline: auto; text-align: left; }
.pick { width: fit-content; max-width: calc(100% - 24px); background: #12110e; border: 2px solid var(--gold); padding: 6px 12px; text-align: center; margin: 12px auto 0; position: relative; z-index: 5; font: 600 17px/1.3 var(--ui); color: #fff3dc; text-shadow: 0 2px 0 rgba(0, 0, 0, .75); }
.oranges { list-style: none; margin: 4px auto 0; padding: 0 12px 8px; display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 4vw, 72px); position: relative; z-index: 5; }
.oranges li { position: relative; }
.orange { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); position: relative; padding-top: var(--len); transform-origin: 50% 0; animation: sway 5s ease-in-out var(--delay) infinite alternate; min-width: 64px; }
.orange .string { position: absolute; left: 50%; top: 0; width: 4px; height: calc(var(--len) + 14px); margin-left: -2px; background: linear-gradient(90deg, #33211a, #6b4630 60%, #8a5d3c); z-index: -1; }
.orange canvas { width: clamp(64px, 9vw, 88px); height: clamp(64px, 9vw, 88px); filter: drop-shadow(0 0 8px rgba(255, 150, 40, .85)) drop-shadow(0 0 22px rgba(255, 150, 40, .45)) drop-shadow(0 5px 0 rgba(0, 0, 0, .3)); transition: transform .15s, filter .15s; margin-top: -10px; }
.orange .label { margin-top: 4px; display: block; background: #12110e; border: 2px solid var(--gold); padding: 6px 8px; font: 700 clamp(14px, 1.6vw, 16px)/1.15 var(--ui); text-align: center; max-width: 11em; }
.orange:hover canvas, .orange:focus-visible canvas { transform: scale(1.1) rotate(-4deg); filter: drop-shadow(0 0 12px rgba(255, 190, 70, 1)) drop-shadow(0 0 32px rgba(255, 170, 50, .7)) drop-shadow(0 5px 0 rgba(0, 0, 0, .3)); }
@keyframes sway { from { transform: rotate(-3.2deg) } to { transform: rotate(3.2deg) } }
.orange.falling { animation: fall .9s cubic-bezier(.5, 0, .9, .6) forwards; pointer-events: none; z-index: 20; }
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  15% { transform: translateY(-8px) rotate(-6deg); }
  70% { transform: translateY(var(--fall, 600px)) rotate(210deg); opacity: 1; }
  82% { transform: translateY(calc(var(--fall, 600px) - 46px)) rotate(250deg); opacity: 1; }
  100% { transform: translateY(var(--fall, 600px)) rotate(290deg); opacity: 0; }
}
.orange.regrow { animation: regrow 1s ease-out both, sway 5s ease-in-out calc(1s + var(--delay)) infinite alternate; }
@keyframes regrow { from { transform: scale(.1); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 56px; }
.trio .panel { padding: 22px 22px 24px; font-size: 16.5px; }

/* ---- trunk sections ---- */
.knot { display: flex; justify-content: center; height: 118px; align-items: center; position: relative; z-index: 4; }
.knot canvas { width: 72px; height: 72px; filter: drop-shadow(0 0 10px rgba(255, 150, 40, .8)) drop-shadow(0 5px 0 rgba(0, 0, 0, .35)); }
.knot.small { height: 88px; }
.knot.small canvas { width: 48px; height: 48px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35)); }
.sec.arrive .knot canvas { animation: land .9s cubic-bezier(.3, 1.4, .6, 1) both; }
@keyframes land { 0% { transform: translateY(-160px) rotate(-120deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.sec.arrive .panel { animation: glow 1.6s ease-out; }
@keyframes glow { 0% { box-shadow: 0 -3px 0 0 #fff, 0 3px 0 0 #fff, -3px 0 0 0 #fff, 3px 0 0 0 #fff, 0 0 0 6px rgba(8, 6, 4, .85), 0 0 80px rgba(255, 190, 70, .7); } 100% { } }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 22px; }
.card { position: relative; background: rgba(255, 243, 220, .06); border: 2px solid rgba(231, 201, 138, .55); padding: 20px 20px 18px 20px; }
.card .ico { width: 48px; height: 48px; float: right; margin: 0 0 8px 12px; }
.role { font: 700 14.5px/1.3 var(--ui); color: #ffbe66; margin-bottom: 6px; }

.timeline { list-style: none; margin: 24px 0 8px; padding: 0 0 0 22px; border-left: 4px solid #8a5d3c; }
.timeline li { position: relative; padding: 0 0 22px 18px; }
.timeline li::before { content: ""; position: absolute; left: -32px; top: 6px; width: 16px; height: 16px; background: var(--orange); box-shadow: 0 0 0 3px #1d0e05, 0 0 12px rgba(255, 150, 40, .7); }
.when { display: inline-block; font-size: 15px; font-weight: 600; color: #ffbe66; margin-bottom: 2px; }
.timeline h3 { font-size: 20px; margin-bottom: 0; }
.org { color: var(--ink-soft); font-size: 16px; margin-bottom: 4px; }
.skills-h { margin-top: 18px; color: #ffb347; }
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skills ul { margin: 0; padding: 0; list-style: none; }
.skills li { padding: 3px 0 3px 18px; position: relative; font-size: 16px; }
.skills li::before { content: ""; position: absolute; left: 0; top: .78em; width: 8px; height: 8px; background: #6fb04a; }
.tool-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tool-list li { border: 2px solid rgba(231, 201, 138, .55); background: rgba(255, 243, 220, .06); padding: 6px 10px; font-size: 16px; }

.about { display: grid; grid-template-columns: 150px 1fr; gap: 28px; align-items: start; }
.about-pic canvas { width: 132px; height: 132px; display: block; margin-bottom: 10px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.branch-panel { text-align: center; overflow: visible; }
.leafrain { position: absolute; left: 0; right: 0; top: 0; height: 0; pointer-events: none; }
.leafrain canvas { position: absolute; width: 28px; height: 28px; animation: leafFall 2.2s ease-in forwards; }
@keyframes leafFall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 330px) rotate(var(--rot)); opacity: 0; } }

/* ---- roots: cabinet ---- */
.roots { padding-bottom: 40px; }
.rootsintro { max-width: 760px; margin-inline: auto; }
.foot { margin-top: 70px; text-align: center; font-size: 15px; color: var(--ink); position: relative; z-index: 5; text-shadow: 0 2px 0 rgba(0, 0, 0, .8); }
.foot p { margin: 0 0 6px; }
a.email { overflow-wrap: anywhere; }


/* ---- reveal-on-scroll (only when JS is on) ---- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .trio { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .cards, .skills, .duo { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 14px; }
  .about-pic { display: flex; gap: 14px; align-items: center; }
  .about-pic canvas { width: 88px; height: 88px; margin: 0; flex: none; }
}
@media (max-width: 600px) {
  :root { --nav-h: 52px; }
  body { font-size: 16.5px; }
  .brand span { display: none; }
  .brand canvas, .brand img { width: 36px; height: 36px; }
  .nav nav a { padding: 0 8px; font-size: 15px; }
  .panel { padding: 22px 16px; }
  .hero { margin-top: 6px; }
  .oranges { gap: 6px; padding: 0 4px; }
  .orange .label { padding: 5px 6px; font-size: 14px; max-width: 106px; }
  .orange { min-width: 0; }
  .knot { height: 96px; }
  .knot canvas { width: 60px; height: 60px; }
}

/* ---- reduced motion: no sway, no falling, no drifting light, instant reveals ---- */
@media (max-width: 360px) {
  .nav { padding: 0 6px; gap: 4px; }
  .nav nav a { padding: 0 5px; font-size: 13px; }
  .brand canvas, .brand img { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .shafts { animation: none; }
  .orange { animation: none; }
  #flies { display: none; }
}
.reduce .orange { animation: none; }
.reduce #flies { display: none; }
.reduce .shafts { animation: none; }

/* ---- arcade teaser and corkboard (homepage roots) ---- */
.tbd.ph { display: block; width: fit-content; margin: 0 0 12px; }
.roots-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; width: 100%; margin: 44px auto 0; position: relative; z-index: 4; }
.arcade-card { display: flex; gap: 26px; align-items: center; max-width: 760px; margin: 44px auto 0; padding: 24px 28px; text-decoration: none; color: var(--ink); position: relative; z-index: 4;
  background: linear-gradient(180deg, #2f1f16, #1a110c);
  box-shadow: 0 -3px 0 0 #ffd27a, 0 3px 0 0 #ffd27a, -3px 0 0 0 #ffd27a, 3px 0 0 0 #ffd27a, 0 0 0 6px rgba(8, 6, 4, .9), 0 14px 0 3px rgba(0, 0, 0, .3), 0 0 70px rgba(255, 150, 40, .35);
  transition: transform .15s, box-shadow .15s; }
.arcade-card:hover { transform: translateY(-3px); box-shadow: 0 -3px 0 0 #fff0c0, 0 3px 0 0 #fff0c0, -3px 0 0 0 #fff0c0, 3px 0 0 0 #fff0c0, 0 0 0 6px rgba(8, 6, 4, .9), 0 14px 0 3px rgba(0, 0, 0, .3), 0 0 100px rgba(255, 170, 60, .55); }
.arcade-card canvas { width: 128px; height: 168px; flex: none; filter: drop-shadow(0 0 14px rgba(255, 150, 40, .8)); }
.arcade-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.arcade-title { font: 800 28px/1.15 var(--ui); color: #fff3dc; }
.arcade-sub { font-size: 17px; color: var(--ink-soft); }
.arcade-go { margin-top: 6px; }
.roots-pair .arcade-card { max-width: none; margin: 0; height: 100%; flex-direction: column; text-align: center; justify-content: center; padding: 22px 18px; gap: 14px; }
.roots-pair .arcade-text { align-items: center; }
.roots-pair .arcade-card canvas { width: 128px; height: 168px; }
.roots-pair .cork-card canvas { width: 96px; height: 96px; }
.missing { min-height: 100vh; display: flex; align-items: center; padding: calc(var(--nav-h) + 32px) 0 48px; }
.missing .mark { width: 96px; height: 96px; display: block; margin: 0 auto 16px; }
.missing h1 { font-size: clamp(32px, 6vw, 48px); }
@media (max-width: 800px) {
  .roots-pair { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .arcade-card { flex-direction: column; text-align: center; padding: 22px 16px; gap: 14px; }
  .arcade-card canvas { width: 96px; height: 126px; }
  .roots-pair .arcade-card canvas { width: 96px; height: 126px; }
  .roots-pair .cork-card canvas { width: 96px; height: 96px; }
  .arcade-text { align-items: center; }
  .arcade-title { font-size: 25px; }
}
