/* KAYX. Japandi edition: washi paper, sumi ink, a quiet ocean, lots of room to breathe. */
:root {
  --paper: #f5f1ea;      /* washi */
  --linen: #ebe5da;
  --sand: #d8cebf;
  --ink: #2a2723;        /* sumi charcoal */
  --ink-2: #4a453e;
  --muted: #857d71;
  --line: #dcd4c7;
  --clay: #a26f57;       /* the one accent, used sparingly */
  --serif: "Shippori Mincho", "Noto Serif JP", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.25, .8, .25, 1);
  --border: #dcd4c7;     /* used by the Flow replica's outer frame */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Poppins", system-ui, sans-serif; font-weight: 300; color: var(--ink); background: var(--paper); line-height: 1.8; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
strong, b { font-weight: 500; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1.5px solid var(--clay); outline-offset: 4px; border-radius: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 76px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 48px);
  color: var(--paper); transition: background .5s var(--ease), color .5s, height .5s var(--ease), border-color .5s;
  border-bottom: 1px solid transparent;
}
.nav.solid { background: rgba(245, 241, 234, .92); backdrop-filter: blur(10px); color: var(--ink); height: 64px; border-color: var(--line); }
.logo { font-weight: 600; font-size: 1.15rem; letter-spacing: .08em; text-decoration: none; }
.nav nav { display: flex; gap: clamp(20px, 3vw, 40px); }
.nav nav a { text-decoration: none; font-size: .9rem; letter-spacing: .04em; position: relative; opacity: .85; }
.nav nav a:hover, .nav nav a.on { opacity: 1; }
.nav nav a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: -6px; height: 1px; background: currentColor; transition: left .4s var(--ease), right .4s var(--ease); }
.nav nav a:hover::after, .nav nav a.on::after { left: 0; right: 0; }
.burger { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 10px; right: 10px; height: 1px; background: currentColor; transition: transform .4s var(--ease); }
.burger span:first-child { top: 16px; } .burger span:last-child { top: 23px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.progress { position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--clay); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; transition: opacity .4s; }
.nav.solid .progress { opacity: 1; }

/* ---------- buttons, small parts ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 28px;
  border-radius: 2px; font-weight: 400; font-size: .92rem; letter-spacing: .04em; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .4s var(--ease), color .4s, border-color .4s;
}
.btn.light { background: var(--paper); color: var(--ink); }
.btn.light:hover { background: var(--linen); }
.btn.ghost-light { border-color: rgba(245, 241, 234, .55); color: var(--paper); background: transparent; }
.btn.ghost-light:hover { background: var(--paper); color: var(--ink); }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.dark:hover { background: var(--ink-2); }
.btn.ghost-dark { border-color: var(--ink); color: var(--ink); }
.btn.ghost-dark:hover { background: var(--ink); color: var(--paper); }
.link { font-weight: 400; text-decoration: none; border-bottom: 1px solid var(--clay); padding-bottom: 2px; transition: color .3s; }
.link:hover { color: var(--clay); }
.kicker { font-family: var(--serif); font-size: .95rem; letter-spacing: .08em; color: var(--muted); margin: 0 0 14px; display: flex; align-items: center; gap: 14px; }
.kicker::after { content: ""; width: 48px; height: 1px; background: var(--sand); }
.title { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.2; font-weight: 400; letter-spacing: -.015em; margin: 0 0 52px; }
.soft { color: var(--muted); font-family: var(--serif); font-weight: 400; }
.pill { font-size: .7rem; font-weight: 400; letter-spacing: .06em; border: 1px solid var(--clay); color: var(--clay); padding: 2px 10px; border-radius: 99px; vertical-align: middle; margin-left: 8px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 18px; }
.tags li { font-size: .76rem; letter-spacing: .03em; padding: 3px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink-2); background: var(--paper); }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(96px, 13vw, 168px) 0; }
.section.light { background: var(--paper); }
.section.grey { background: var(--linen); }
.wave { position: relative; background: #2a2723 url("assets/img/wave-2000.jpg") center / cover no-repeat; color: var(--paper); overflow: hidden; }
@media (max-width: 900px) { .wave { background-image: url("assets/img/wave-900.jpg"); } }
/* a warm sumi wash over the black-and-white ocean */
.wave::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(42, 39, 35, .35), rgba(42, 39, 35, .6)); mix-blend-mode: multiply; z-index: 1; }
.wave::after { content: ""; position: absolute; inset: 0; background: rgba(162, 111, 87, .08); z-index: 1; pointer-events: none; }
.wave > .wrap { position: relative; z-index: 2; }
.wave .kicker { color: rgba(245, 241, 234, .7); }
.wave .kicker::after { background: rgba(245, 241, 234, .35); }
.grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .09; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: grid; place-items: center; text-align: center; }
.hero-inner { position: relative; z-index: 2; padding: 120px 20px 140px; will-change: transform, opacity; }
.eyebrow { font-family: var(--serif); letter-spacing: .14em; font-size: .95rem; color: rgba(245, 241, 234, .8); margin: 0 0 26px; }
.name { margin: 0; font-weight: 500; font-size: clamp(2.8rem, 8.5vw, 7.2rem); line-height: 1.04; letter-spacing: -.025em; }
.name .line { display: block; overflow: hidden; padding-bottom: .08em; }
.name .line > span { display: inline-block; transform: translateY(100%); animation: rise 1.6s var(--ease) forwards; }
.name .line:nth-child(2) > span { animation-delay: .18s; font-weight: 300; }
@keyframes rise { to { transform: none; } }
.lead { max-width: 520px; margin: 30px auto 0; font-size: clamp(.98rem, 1.5vw, 1.08rem); font-weight: 300; color: rgba(245, 241, 234, .85); }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.reveal-up { opacity: 0; animation: fadeIn 1.4s var(--ease) forwards; animation-delay: .7s; }
.cta.reveal-up { animation-delay: .95s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero-foot { position: absolute; z-index: 2; left: 0; right: 0; bottom: 30px; display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 26px; }
.chip { display: inline-flex; align-items: center; gap: 10px; font-size: .8rem; letter-spacing: .05em; padding: 7px 18px; border-radius: 99px; border: 1px solid rgba(245, 241, 234, .3); color: rgba(245, 241, 234, .9); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #c99a7f; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.scroll { width: 1px; height: 46px; background: rgba(245, 241, 234, .3); position: relative; overflow: hidden; border: 0; }
.scroll span { position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--paper); animation: drop 2.4s var(--ease) infinite; }
@keyframes drop { to { top: 100%; } }

/* ---------- now: an ensō and three quiet lines ---------- */
.now { background: var(--paper); border-bottom: 1px solid var(--line); padding: clamp(48px, 7vw, 80px) 0; }
.now-inner { display: grid; grid-template-columns: auto 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.enso { width: clamp(84px, 10vw, 120px); height: auto; overflow: visible; }
.enso-ink { fill: var(--ink); opacity: .85; }
.enso-reveal { fill: none; stroke: #fff; stroke-width: 16; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s cubic-bezier(.55, .05, .35, 1); }
.enso.drawn .enso-reveal { stroke-dashoffset: 0; }
.now-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.now-grid > div { padding: 4px 28px; border-left: 1px solid var(--line); }
.now-grid span { font-family: var(--serif); font-size: .9rem; color: var(--clay); letter-spacing: .06em; }
.now-grid p { margin: 6px 0 0; color: var(--ink-2); font-size: .95rem; line-height: 1.7; }
@media (max-width: 760px) {
  .now-inner { grid-template-columns: 1fr; justify-items: start; }
  .now-grid { grid-template-columns: 1fr; gap: 18px; }
  .now-grid > div { padding: 0 0 0 18px; }
}
@media (prefers-reduced-motion: reduce) { .enso-reveal { stroke-dashoffset: 0; } }

/* ---------- work ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 44px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 14px 20px 14px 0; margin-right: 18px; font-weight: 300; color: var(--muted); cursor: pointer; position: relative; font-size: 1rem; transition: color .4s; }
.tab small { font-family: var(--serif); font-size: .8rem; color: var(--sand); margin-right: 10px; }
.tab::after { content: ""; position: absolute; left: 0; right: 20px; bottom: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--ink); }
.tab.active small { color: var(--clay); }
.tab.active::after { transform: scaleX(1); }
.project { animation: fadeIn .8s var(--ease); }
.project-head { display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; margin-bottom: 30px; }
.project h3 { font-size: 1.8rem; font-weight: 400; margin: 0 0 14px; letter-spacing: -.01em; }
.tagline { display: block; font-family: var(--serif); font-size: 1rem; color: var(--muted); margin-top: 4px; }
.project p { color: var(--ink-2); margin: 0; }
.project em { font-style: normal; border-bottom: 1px solid var(--sand); }
.project aside { padding-top: 8px; border-left: 1px solid var(--line); padding-left: 28px; }
.note { font-family: var(--serif); font-size: .92rem; color: var(--muted) !important; margin: 0 0 16px !important; }
.embed { position: relative; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: var(--linen); }
.embed iframe { width: 100%; height: 720px; border: 0; display: block; background: #fff; }
.embed .shot { position: relative; }
.embed .shot img { width: 100%; }
.embed .shot .overlay { position: absolute; inset: auto 0 0; padding: 70px 28px 24px; background: linear-gradient(transparent, rgba(42, 39, 35, .85)); color: var(--paper); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.embed .shot .overlay p { color: var(--paper); margin: 0 auto 0 0; font-size: .9rem; }
.embed .soon { padding: 80px 24px; text-align: center; color: var(--muted); font-family: var(--serif); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: .82fr 1.18fr; gap: clamp(40px, 7vw, 96px); align-items: start; }
.portrait { margin: 0; position: sticky; top: 110px; padding: 14px 14px 0; background: var(--paper); border: 1px solid var(--line); }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 45%; }
.portrait figcaption { font-family: var(--serif); font-size: .82rem; color: var(--muted); padding: 12px 2px 14px; display: flex; justify-content: space-between; }
.about-text p { color: var(--ink-2); }
.about-text strong { color: var(--ink); }
.facts { list-style: none; display: flex; gap: 0; padding: 0; margin: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts li { flex: 1; padding: 20px 0 18px; }
.facts li + li { border-left: 1px solid var(--line); padding-left: 24px; }
.facts strong { display: block; font-size: 2.1rem; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.facts span { color: var(--muted); font-size: .8rem; letter-spacing: .04em; }
.next-index { margin-top: -6px; }
.next-title { font-family: var(--serif); font-size: .9rem; letter-spacing: .08em; color: var(--muted); margin: 22px 0 6px; }
.next-index a { display: flex; align-items: baseline; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; font-size: 1.15rem; font-weight: 300; color: var(--ink); transition: color .4s, padding .5s var(--ease); }
.next-index a span { font-family: var(--serif); font-size: .82rem; color: var(--muted); width: 22px; transition: color .4s; }
.next-index a i { margin-left: auto; font-style: normal; color: var(--muted); transition: transform .5s var(--ease), color .4s; }
.next-index a:hover { color: var(--clay); padding-left: 6px; }
.next-index a:hover span, .next-index a:hover i { color: var(--clay); }
.next-index a:hover i { transform: translateX(6px); }

/* ---------- journey: a stacked card deck, oldest to newest ---------- */
.deck { outline: none; }
.deck-stage { position: relative; height: 330px; max-width: 980px; margin: 0 auto; touch-action: pan-y; user-select: none; }
.dcard {
  --d: 0;
  position: absolute; left: 50%; top: 0; width: min(520px, 84vw); height: 300px; margin-left: calc(min(520px, 84vw) / -2);
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 36px 40px;
  display: flex; flex-direction: column; cursor: pointer;
  transition: transform .9s var(--ease), opacity .9s var(--ease), filter .9s var(--ease), box-shadow .9s var(--ease);
  transform: translateX(calc(var(--d) * 46%)) scale(.84); opacity: 1; z-index: 1;
}
.dcard[data-pos="front"] { transform: none; opacity: 1; z-index: 3; cursor: default; box-shadow: 0 30px 60px -30px rgba(42, 39, 35, .35); }
.dcard[data-pos="near"] { z-index: 2; background: #efe9df; }
.dcard > * { transition: opacity .9s var(--ease); }
.dcard[data-pos="near"] > * { opacity: .38; }
.dcard[data-pos="far"] > * { opacity: .15; }
.dcard[data-pos="far"] { transform: translateX(calc(var(--d) * 36%)) scale(.7); opacity: .7; z-index: 1; background: #ebe4d9; }
.dcard[data-pos="gone"] { transform: translateX(calc(var(--d) * 30%)) scale(.6); opacity: 0; pointer-events: none; }
.dcard[data-pos="near"]:hover > * { opacity: .7; }
.dyear { font-family: var(--serif); font-size: 3.2rem; line-height: 1; color: var(--sand); margin-bottom: auto; transition: color .9s; }
.dcard[data-pos="front"] .dyear { color: var(--clay); }
.dcard h3 { margin: 0; font-size: 1.35rem; font-weight: 500; }
.dcard .dplace { margin: 2px 0 10px; font-family: var(--serif); color: var(--muted); }
.dcard p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.dcard.next { border: 1px dashed var(--clay); }
.dcard.next .link { margin-top: 12px; align-self: flex-start; }

.deck-nav { display: flex; align-items: center; gap: 22px; max-width: 760px; margin: 34px auto 0; }
.deck-arrow { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--sand); background: transparent; color: var(--ink); cursor: pointer; font-size: 1rem; transition: border-color .4s, background .4s; }
.deck-arrow:hover:not(:disabled) { border-color: var(--ink); background: var(--paper); }
.deck-arrow:disabled { opacity: .3; cursor: default; }
.rail { position: relative; flex: 1; display: flex; justify-content: space-between; }
.rail::before, .rail-fill { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 1px; background: var(--sand); }
.rail-fill { right: auto; background: var(--clay); transition: width .9s var(--ease); max-width: calc(100% - 12px); }
.rail button { position: relative; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail button i { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--sand); background: var(--linen); transition: background .5s, border-color .5s, transform .5s var(--ease); }
.rail button span { font-family: var(--serif); font-size: .82rem; color: var(--muted); transition: color .4s; }
.rail button.past i { background: var(--clay); border-color: var(--clay); }
.rail button.on i { background: var(--ink); border-color: var(--ink); transform: scale(1.25); }
.rail button.on span { color: var(--ink); }
.rail button:hover span { color: var(--clay); }
.deck-hint { text-align: center; font-family: var(--serif); font-size: .82rem; color: var(--muted); margin: 22px 0 0; }

@media (max-width: 680px) {
  .deck-stage { height: 330px; }
  .dcard { padding: 28px 26px; height: 310px; }
  .dcard { transform: translateX(calc(var(--d) * 14%)) scale(.9); }
  .dcard[data-pos="far"] { transform: translateX(calc(var(--d) * 10%)) scale(.82); opacity: 0; }
  .dyear { font-size: 2.6rem; }
  .deck-nav { gap: 10px; }
  .deck-arrow { width: 38px; height: 38px; }
  .rail button span { font-size: .7rem; }
}

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.skill { padding: 30px 28px 34px 0; border-bottom: 1px solid var(--line); transition: padding .5s var(--ease); }
.skill:nth-child(3n+2), .skill:nth-child(3n+3) { padding-left: 28px; border-left: 1px solid var(--line); }
.skill h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 500; }
.skill h3::before { content: "— "; color: var(--clay); }
.skill p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.langs { display: flex; flex-wrap: wrap; gap: 10px 36px; margin-top: 40px; font-family: var(--serif); font-size: 1.05rem; }
.langs b { font-family: "Poppins", sans-serif; font-weight: 300; color: var(--muted); font-size: .8rem; margin-left: 6px; }

/* ---------- beyond code ---------- */
.hobbies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.hobby { padding: 0; border: 0; border-radius: 4px; overflow: hidden; background: var(--ink); cursor: pointer; text-align: left; position: relative; }
.hobby img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1.4s var(--ease), opacity .6s; }
.hobby:hover img { transform: scale(1.035); opacity: .92; }
.hobby span { display: block; color: var(--paper); font-weight: 400; padding: 16px 20px 18px; letter-spacing: .02em; }
.hobby span small { display: block; font-family: var(--serif); font-size: .84rem; color: #b5ab9c; margin-top: 2px; }
.hobby span::after { content: "+"; float: right; margin-top: -24px; font-weight: 200; font-size: 1.2rem; transition: transform .6s var(--ease); }
.hobby:hover span::after { transform: rotate(90deg); }
.hobby-dialog { border: 0; padding: 0; border-radius: 4px; max-width: 760px; width: calc(100% - 32px); overflow: hidden; background: var(--paper); color: var(--ink); }
.hobby-dialog[open] { display: grid; grid-template-columns: 1fr 1.2fr; animation: fadeIn .6s var(--ease); }
.hobby-dialog::backdrop { background: rgba(42, 39, 35, .55); backdrop-filter: blur(3px); }
.hobby-dialog img { width: 100%; height: 100%; object-fit: cover; min-height: 300px; }
.hobby-dialog > div { padding: 36px; }
.hobby-dialog h3 { margin: 0 0 10px; font-size: 1.5rem; font-weight: 400; }
.hobby-dialog p { color: var(--ink-2); font-size: .94rem; }

/* ---------- contact: a sheet of paper resting on the wave ---------- */
.contact { min-height: 86vh; display: grid; place-items: center; }
.glass { max-width: 620px; margin: 0 auto; text-align: center; background: var(--paper); color: var(--ink); padding: clamp(36px, 6vw, 64px); border-radius: 4px; }
.glass .kicker { color: var(--muted); justify-content: center; }
.glass .kicker::after { background: var(--sand); }
.glass p { color: var(--ink-2); }
.glass .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.glass .btn.light { background: var(--ink); color: var(--paper); }
.glass .btn.light:hover { background: var(--ink-2); }
.glass .btn.ghost-light { border-color: var(--sand); color: var(--ink); }
.glass .btn.ghost-light:hover { background: var(--linen); color: var(--ink); }
.copy { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; padding: 8px 10px 8px 18px; border-radius: 99px; background: transparent; border: 1px solid var(--line); cursor: pointer; font-family: var(--mono); font-size: .82rem; color: var(--ink-2); transition: border-color .4s; }
.copy:hover { border-color: var(--clay); }
.copy b { font-family: "Poppins", sans-serif; font-size: .72rem; font-weight: 400; letter-spacing: .04em; background: var(--linen); color: var(--ink); border-radius: 99px; padding: 3px 12px; }
.clocks { display: flex; justify-content: center; gap: 0; margin-top: 34px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 22px; }
.clocks > div { padding: 0 30px; }
.clocks > div + div { border-left: 1px solid var(--line); }
.clocks b { display: block; color: var(--ink); font-size: 1.4rem; font-weight: 300; font-variant-numeric: tabular-nums; }

/* ---------- footer: tone-on-tone wordmark ---------- */
footer { background: var(--ink); color: #9d958a; padding: clamp(60px, 9vw, 110px) clamp(20px, 5vw, 48px) 28px; overflow: hidden; font-size: .85rem; }
.foot-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; }
.wordmark { font-weight: 600; color: #36322d; font-size: clamp(4.5rem, 18vw, 14rem); line-height: .8; letter-spacing: -.03em; margin: 0; user-select: none; }
.foot-links { display: flex; gap: 26px; flex-wrap: wrap; }
.foot-links a { color: #cfc7bb; text-decoration: none; letter-spacing: .03em; transition: color .3s; }
.foot-links a:hover { color: var(--paper); }
.foot-bottom { max-width: 1100px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid #3a3631; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .8rem; }

/* ---------- scroll reveal: slow and soft ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Flow replica: the wave as its wallpaper ---------- */
/* the demo breaks out of the text column so the desktop inside is readable */
#flowDemo { width: min(1400px, calc(100vw - 48px)); margin-left: calc((100% - min(1400px, calc(100vw - 48px))) / 2); }
#flowDemo .fl-stage { background: #2a2723 url("assets/img/wave-2000.jpg") center 40% / cover no-repeat; }
#flowDemo .fl-stage::before { content: ""; position: absolute; inset: 0; background: rgba(42, 39, 35, .35); }
#flowDemo .fl-stage p { color: inherit; margin: 6px 0; }
#flowDemo .fl-stage .fl-toast p { color: var(--MUTED); margin: 2px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .project-head, .about { grid-template-columns: 1fr; gap: 28px; }
  .project aside { border-left: 0; padding-left: 0; }
  .portrait { position: static; max-width: 400px; }
  .skills { grid-template-columns: 1fr 1fr; }
  .skill:nth-child(n) { padding-left: 0; border-left: 0; }
  .skill:nth-child(2n) { padding-left: 24px; border-left: 1px solid var(--line); }
  .hobbies { grid-template-columns: 1fr 1fr; gap: 20px; }
  .embed iframe { height: 640px; }
}
@media (max-width: 680px) {
  .nav { background: rgba(245, 241, 234, .95); color: var(--ink); height: 64px; border-color: var(--line); backdrop-filter: blur(10px); }
  .nav nav { position: fixed; inset: 64px 0 auto; background: var(--paper); flex-direction: column; gap: 0; padding: 8px 0 22px; border-bottom: 1px solid var(--line); transform: translateY(-130%); transition: transform .5s var(--ease); }
  .nav nav.open { transform: none; }
  .nav nav a { padding: 12px 24px; font-size: 1.05rem; }
  .burger { display: block; }
  .skills, .hobbies { grid-template-columns: 1fr; }
  .skill:nth-child(n) { padding-left: 0; border-left: 0; }
  .timeline::before, .timeline::after { display: none; }
  .chip { font-size: .7rem; letter-spacing: .02em; padding: 6px 14px; }
  .timeline > li { grid-template-columns: 1fr; gap: 10px; }
  .year { justify-self: start; padding: 4px 12px; }
  .card { padding: 22px; }
  .hobby-dialog[open] { grid-template-columns: 1fr; }
  .hobby-dialog img { max-height: 240px; min-height: 0; }
  .facts li + li { padding-left: 16px; }
  .facts strong { font-size: 1.6rem; }
  .tab { margin-right: 6px; padding-right: 12px; font-size: .95rem; }
  .eyebrow { letter-spacing: .08em; font-size: .85rem; }
  .clocks > div { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .name .line > span, .reveal-up, .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   Section upgrades
   ========================================================= */

/* hero: vertical side caption + scroll label */
.side-note { position: absolute; z-index: 2; right: clamp(18px, 3vw, 40px); top: 50%; transform: translateY(-50%); writing-mode: vertical-rl;
  font-family: var(--serif); font-size: .85rem; letter-spacing: .3em; color: rgba(245, 241, 234, .55); margin: 0; display: flex; align-items: center; gap: 14px; }
.side-note i { width: 1px; height: 40px; background: rgba(245, 241, 234, .35); }
.scroll-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; }
.scroll-label { font-family: var(--serif); font-size: .72rem; letter-spacing: .3em; color: rgba(245, 241, 234, .6); }

/* work: three key facts per project */
.pfacts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.pfacts div + div { border-left: 1px solid var(--line); padding-left: 14px; }
.pfacts dt { font-size: 1.5rem; font-weight: 300; line-height: 1.2; color: var(--ink); }
.pfacts dd { margin: 2px 0 0; font-size: .74rem; line-height: 1.4; color: var(--muted); padding-right: 8px; }

/* about: how I work */
.principles { list-style: none; padding: 0; margin: 0 0 40px; }
.principles li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.principles li:first-child { border-top: 1px solid var(--line); }
.principles span { font-family: var(--serif); font-size: .95rem; color: var(--clay); line-height: 1.9; letter-spacing: .04em; }
.principles b { font-weight: 500; }
.principles p { margin: 2px 0 0; font-size: .92rem; }

/* journey: simpler, one line each */
.card { padding: 20px 26px; }
.card .org { margin-top: 4px; }
.card.next .link { display: inline-block; margin-top: 10px; }

/* toolkit: where each skill was used */
.skill .used { display: block; margin-top: 12px; font-family: var(--serif); font-size: .82rem; color: var(--clay); }

/* beyond code: editorial grid, one tall card and one wide panorama */
.hobbies { grid-auto-flow: dense; }
.hobby { display: flex; flex-direction: column; }
.hobby img { flex: 1; min-height: 0; }
.hobby.tall { grid-row: span 2; }
.hobby.tall img { aspect-ratio: auto; }
.hobby.wide { grid-column: 1 / -1; }
.hobby.wide img { aspect-ratio: 3 / 1; object-position: 50% 60%; }

/* contact: 2027 availability */
.avail { margin: 30px auto 6px; max-width: 420px; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.months span { font-family: var(--serif); font-size: .8rem; padding: 6px 0 5px; border: 1px solid var(--line); color: var(--sand); border-radius: 2px; }
.months span.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.avail p { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }

@media (max-width: 900px) {
  .hobby.tall { grid-row: span 1; }
  .hobby.tall img { aspect-ratio: 4 / 3; }
  .hobby.wide img { aspect-ratio: 2 / 1; }
  .side-note { display: none; }
}
@media (max-width: 680px) {
  .pfacts dt { font-size: 1.25rem; }
  .months span { font-size: .7rem; }
}

/* one clear path: each section ends with a quiet link to the next one */
.next-link { display: flex; align-items: baseline; gap: 14px; margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--line);
  text-decoration: none; color: var(--ink); font-size: 1.05rem; font-weight: 300; transition: color .4s; }
.next-link span { font-family: var(--serif); font-size: .85rem; letter-spacing: .08em; color: var(--muted); min-width: 44px; }
.next-link i { margin-left: auto; font-style: normal; color: var(--clay); transition: transform .5s var(--ease); }
.next-link:hover { color: var(--clay); }
.next-link:hover i { transform: translateY(4px); }
.about-text .next-link { margin-top: 40px; }

/* the cards waiting behind the deck must never widen the page (it pushed the phone menu button off-screen) */
#journey { overflow-x: clip; }
html, body { overflow-x: clip; }

/* Tabi */
.badge { display: inline-block; vertical-align: middle; font-size: .7rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border: 1px solid var(--clay); color: var(--clay); border-radius: 99px; margin-left: 8px; }
#tab-tabi .note { margin-top: 14px !important; }
.shots { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; gap: 18px; }
.shot { margin: 0; }
.shot.main { grid-row: span 2; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.shot figcaption { font-family: var(--serif); font-size: .85rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 760px) { .shots { grid-template-columns: 1fr; } .shot.main { grid-row: auto; } }

/* moving sea (wave.js); the photo shows until the first frame is drawn */
.wave-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.wave-live .wave-canvas { opacity: 1; }
/* the still photo is lighter than the live sea, so shade it more until the sea takes over */
.wave:not(.wave-live)::before { background: linear-gradient(180deg, rgba(20, 18, 16, .55), rgba(20, 18, 16, .78)); }

/* ---------- outside of code (v2): photo above, caption on paper ---------- */
.hobby-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin: -12px 0 40px; }
.lead-sm { max-width: 560px; margin: 0; color: var(--ink-2); font-weight: 300; }
.shuffle { flex: none; display: inline-flex; align-items: center; gap: 10px; background: none; border: 1px solid var(--line); border-radius: 99px; padding: 10px 20px; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; transition: border-color .4s, background .4s; }
.shuffle i { font-style: normal; display: inline-block; transition: transform .8s var(--ease); }
.shuffle:hover { border-color: var(--ink); background: var(--paper); }
.shuffle:hover i { transform: rotate(-180deg); }
.hobbies { transition: opacity .35s ease; }
.hobbies.fading { opacity: 0; }
.hobby { background: none; border-radius: 0; overflow: visible; color: var(--ink); animation: fadeIn .8s var(--ease) both; }
.hobby:nth-child(2) { animation-delay: .06s } .hobby:nth-child(3) { animation-delay: .12s }
.hobby:nth-child(4) { animation-delay: .18s } .hobby:nth-child(5) { animation-delay: .24s } .hobby:nth-child(6) { animation-delay: .3s }
.hobby-img { display: block; flex: 1; min-height: 0; overflow: hidden; border-radius: 6px; background: var(--sand); }
.hobby-img img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1.4s var(--ease); }
.hobby:hover .hobby-img img { transform: scale(1.04); opacity: 1; }
.hobby.tall .hobby-img img { aspect-ratio: auto; }
.hobby.wide .hobby-img img { aspect-ratio: 3 / 1; }
.hobby .hobby-cap { display: flex; align-items: baseline; gap: 12px; padding: 14px 2px 0; color: var(--ink); }
.hobby .hobby-cap b { font-weight: 400; }
.hobby .hobby-cap small { margin: 0; font-family: var(--serif); font-size: .84rem; color: var(--muted); flex: 1; }
.hobby .hobby-cap::after { content: "+"; float: none; margin: 0; color: var(--muted); }
.hobby:hover .hobby-cap::after { color: var(--clay); }
.hobby:focus-visible { outline: 1px solid var(--clay); outline-offset: 6px; }
.hobby-more { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.hobby-more > span:first-child { font-family: var(--serif); font-size: .9rem; color: var(--muted); }
#hobbyMore { display: contents; }
.chip { background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 6px 16px; font: inherit; font-size: .86rem; color: var(--ink-2); cursor: pointer; transition: border-color .3s, color .3s; }
.chip:hover { border-color: var(--clay); color: var(--ink); }
.hd-count { font-family: var(--serif); font-size: .85rem; color: var(--clay); margin: 0 0 8px; letter-spacing: .08em; }
.hobby-dialog > div { display: flex; flex-direction: column; }
.hd-text { flex: 1; }
.hd-nav { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.hd-nav form { margin-left: auto; }
.hd-arrow { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; font-size: 1rem; transition: border-color .3s; }
.hd-arrow:hover { border-color: var(--ink); }
@media (max-width: 700px) {
  .hobby-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hobby.wide .hobby-img img { aspect-ratio: 2 / 1; }
}
.hobby .hobby-img { padding: 0; }
.hobby .hobby-img::after { content: none; }
.hobby .hobby-cap { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 2px; }
.hobby .hobby-cap small { grid-row: 2; }
.hobby .hobby-cap::after { grid-row: 1; grid-column: 2; }

/* ---------- screenshots: bigger, and they open full size ---------- */
.shots { grid-template-columns: 1fr 1fr; grid-template-rows: none; gap: 22px; }
.shot.main { grid-row: auto; grid-column: 1 / -1; }
.shot img { cursor: zoom-in; box-shadow: 0 18px 40px -24px rgba(42, 39, 35, .45); }
.zoom-hint { font-family: var(--serif); font-size: .85rem; color: var(--muted); margin: 14px 0 0 !important; }
.zoom { border: 0; padding: 0; background: none; max-width: min(1500px, 96vw); width: auto; overflow: visible; }
.zoom[open] { display: flex; flex-direction: column; align-items: center; animation: fadeIn .4s var(--ease); }
.zoom::backdrop { background: rgba(20, 18, 16, .88); backdrop-filter: blur(4px); }
.zoom img { display: block; max-width: 96vw; max-height: 84vh; width: auto; height: auto; border-radius: 6px; cursor: zoom-out; }
.zoom p { color: #d8cebf; font-family: var(--serif); font-size: .9rem; margin: 12px 0 0; text-align: center; padding: 0 12px; }
.zoom form { position: fixed; top: 14px; right: 14px; margin: 0; }
.zoom-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(245, 241, 234, .3); background: rgba(20, 18, 16, .6); color: #f5f1ea; font-size: 1rem; cursor: pointer; }

/* Flow on phones: a swipeable gallery replaces the live desktop, which is too small to use there */
.phone-gallery { display: none; }
@media (max-width: 900px) {
  #flowDemo, .demo-note { display: none !important; }
  .phone-gallery { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 6px -20px 0; padding: 4px 20px 12px; scrollbar-width: none; }
  .phone-gallery::-webkit-scrollbar { display: none; }
  .phone-gallery .shot { flex: 0 0 82%; scroll-snap-align: center; }
  .phone-gallery .shot { flex-basis: min(82%, 560px); }
  .phone-gallery .shot img { width: 100%; height: clamp(260px, 50vw, 420px); object-fit: contain; background: #0e1116; border-radius: 8px; border: 0; }
}
@media (max-width: 700px) {
  .shots { grid-template-columns: 1fr; gap: 18px; }
  .zoom-hint { display: none; }
}
.hobby .hobby-cap { padding-top: 12px; }
.hobby-dialog img { filter: none; }
/* hobbies on tablets and phones: a two-column board (tall card + two beside it, two more, then the wide one) */
@media (max-width: 900px) {
  .hobbies { grid-template-columns: 1fr 1fr; gap: 22px 16px; }
  .hobby.tall { grid-row: span 2; }
  .hobby.tall .hobby-img img { aspect-ratio: auto; }
  .hobby.wide .hobby-img img { aspect-ratio: 2 / 1; }
}
@media (max-width: 480px) {
  .hobby .hobby-cap { font-size: .9rem; padding-top: 8px; }
  .hobby:not(.tall):not(.wide) .hobby-img img { aspect-ratio: 1 / 1; }
}
/* fixed hobby board: 2 tall cards + 8 = 4 rows of 3 (or 6 rows of 2) */
.hobbies { grid-template-columns: repeat(3, 1fr); }
.hobby.tall { grid-row: span 2; }
.hobby.tall .hobby-img img { aspect-ratio: auto; }
@media (max-width: 900px) { .hobbies { grid-template-columns: 1fr 1fr; } }
.hobby.tall img[src*="nature-a8"] { object-position: 40% 50%; }

/* ---------- outside of code: words in boxes (no photos) ---------- */
.interests { list-style: none; margin: 0; padding: 0; columns: 3 260px; column-gap: 18px; }
.interests li { break-inside: avoid; margin: 0 0 18px; padding: 22px 24px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; transition: border-color .4s, transform .6s var(--ease); }
.interests li:hover { border-color: var(--sand); transform: translateY(-2px); }
.interests h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 400; letter-spacing: .01em; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.interests h3::before { content: ""; width: 14px; height: 1px; background: var(--clay); flex: none; }
.interests p { margin: 0; font-family: var(--serif); font-size: .92rem; line-height: 1.65; color: var(--ink-2); }
@media (max-width: 700px) { .interests { columns: 2 150px; column-gap: 12px; } .interests li { padding: 18px 18px 20px; margin-bottom: 12px; } .interests h3 { font-size: .98rem; } .interests p { font-size: .86rem; } }
.interests h3 { align-items: flex-start; }
.interests h3::before { margin-top: .72em; }
