/* ---------------------------------------------------------
   Two sides of one island.
   Personal = daytime on top. Professional = night underneath.
   --------------------------------------------------------- */
:root {
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --bar-h: 68px;
  --r-xl: 30px;
  --r-l: 22px;
  --r-m: 16px;
  --ease: cubic-bezier(.3, .7, .2, 1);
}

body {
  color-scheme: light;
  --page: #eef2ef;
  --surface: #ffffff;
  --surface-2: #e2e9e4;
  --ink: #18222e;
  --text: #34404c;
  --muted: #5f6b76;
  --line: #d4dcd6;
  --accent: #2f6b4f;
  --on-accent: #ffffff;
  --inset: inset 0 1px 0 rgba(255, 255, 255, .95);
  --lift: 0 26px 48px -28px rgba(24, 34, 46, .42), 0 2px 6px rgba(24, 34, 46, .06);
  --rest: 0 1px 2px rgba(24, 34, 46, .06);
}
body[data-mode="professional"] {
  color-scheme: dark;
  --page: #1f2136;
  --surface: #2a2d48;
  --surface-2: #34375a;
  --ink: #f3f2fa;
  --text: #d6d5e8;
  --muted: #a3a2c2;
  --line: #3b3e62;
  --accent: #a7b1ff;
  --on-accent: #171930;
  --inset: inset 0 1px 0 rgba(255, 255, 255, .07);
  --lift: 0 26px 48px -26px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .25);
  --rest: 0 1px 2px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------
   Base
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 12px); }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .7s var(--ease), color .7s var(--ease);
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 650; transition: color .7s var(--ease); }
p { margin: 0; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--page); padding: 10px 16px; border-radius: 12px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.display {
  font-size: clamp(2.7rem, 4.4vw + 1rem, 5.4rem);
  font-weight: 720;
  font-stretch: 84%;
  line-height: .95;
  letter-spacing: -0.035em;
  max-width: 10.5ch;
  text-wrap: balance;
}
h2 {
  font-size: clamp(2rem, 2.6vw + 1rem, 3.1rem);
  font-weight: 680;
  font-stretch: 86%;
  line-height: 1.02;
  letter-spacing: -0.025em;
}
h3 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.01em; }
.lede { font-size: clamp(1.1rem, .5vw + 1rem, 1.28rem); color: var(--muted); max-width: 36ch; margin-top: 20px; transition: color .7s var(--ease); }

/* ---------------------------------------------------------
   Buttons and links
   --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 650 .97rem/1 var(--font); text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent;
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .3s ease, transform .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 20px -12px color-mix(in srgb, var(--accent) 80%, black);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-ghost {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  border-color: var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: .92rem; }

.text-link {
  color: var(--accent); font-weight: 650;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  transition: color .5s var(--ease);
}
.text-link:hover { text-decoration-thickness: 2.5px; }

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  min-height: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))) 0;
  transition: background-color .4s ease, box-shadow .4s ease;
}
.bar.is-scrolled {
  background: color-mix(in srgb, var(--page) 80%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  box-shadow: 0 1px 0 var(--line);
}
.wordmark { justify-self: start; color: var(--ink); text-decoration: none; font-weight: 720; font-stretch: 86%; font-size: 1.15rem; letter-spacing: -0.02em; transition: color .7s var(--ease); }
.bar-follow { justify-self: end; }

.switch {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08);
  transition: background-color .7s var(--ease);
}
.switch-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--inset), 0 4px 10px -4px rgba(0, 0, 0, .25);
  transition: transform .55s var(--ease), background-color .7s var(--ease);
}
body[data-mode="professional"] .switch-thumb { transform: translateX(100%); }
.switch-tab {
  position: relative; z-index: 1; appearance: none; border: 0; background: none; cursor: pointer;
  font: 650 .93rem/1 var(--font); color: var(--muted); padding: 11px 18px; border-radius: 999px;
  transition: color .5s var(--ease);
}
.switch-tab[aria-selected="true"] { color: var(--ink); }

/* ---------------------------------------------------------
   Hero with the island
   --------------------------------------------------------- */
.hero { position: relative; height: max(640px, min(100svh, 980px)); overflow: hidden; isolation: isolate; }
.sky { position: absolute; inset: 0; z-index: -2; transition: opacity .9s var(--ease); }
.sky-day { background: linear-gradient(180deg, #bfd5e1 0%, #d9e5e9 52%, #eef2ef 100%); }
.sky-night { background: linear-gradient(180deg, #121428 0%, #22244a 58%, #1f2136 100%); opacity: 0; }
body[data-mode="professional"] .sky-night { opacity: 1; }

#island { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; touch-action: pan-y; cursor: grab; }
#island.is-dragging { cursor: grabbing; }
#island.is-pointing { cursor: pointer; }

.island-poster { display: none; position: absolute; z-index: -1; right: 0; top: 50%; transform: translateY(-50%); width: min(62%, 900px); }
.no-webgl #island { display: none; }
.no-webgl body[data-mode="personal"] .poster-personal,
.no-webgl body[data-mode="professional"] .poster-professional { display: block; }

.hero-inner { position: relative; height: 100%; display: flex; align-items: center; pointer-events: none; padding-top: var(--bar-h); }
.hero-copy { pointer-events: auto; max-width: 560px; }
.hero-copy.is-entering { animation: copy-in .6s var(--ease); }
@keyframes copy-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.stats { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 40px 0 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font-size: 1.8rem; font-weight: 700; font-stretch: 84%; color: var(--ink); line-height: 1.05; transition: color .7s var(--ease); }
.stats dt { font-size: .9rem; color: var(--muted); }

.hint {
  position: absolute; right: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); bottom: 22px;
  font-size: .88rem; font-weight: 550; color: var(--muted); pointer-events: none; transition: color .7s var(--ease);
}
.hint-touch { display: none; }
@media (hover: none) { .hint-fine { display: none; } .hint-touch { display: inline; } }
.no-webgl .hint { display: none; }

.island-tip, .bubble {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  opacity: 0; transition: opacity .18s ease;
  font-weight: 650; font-size: .9rem; white-space: nowrap;
}
.island-tip { background: var(--ink); color: var(--page); padding: 7px 12px; border-radius: 12px; transform: translate(14px, -50%); }
.island-tip.show { opacity: 1; }
.bubble {
  background: #fffdf7; color: #18222e; padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .45);
  transform: translate(-10%, -120%);
}
.bubble.show { opacity: 1; }

/* ---------------------------------------------------------
   Content
   --------------------------------------------------------- */
.panel { padding-bottom: 24px; }
.panel.is-entering { animation: copy-in .6s var(--ease); }
.block { padding-top: clamp(64px, 9vw, 120px); }
.block-head { display: grid; gap: 10px; margin-bottom: 34px; }
.block-head p { color: var(--muted); max-width: 54ch; }

.card {
  background: var(--surface); border-radius: var(--r-xl); padding: clamp(24px, 3.4vw, 40px);
  box-shadow: var(--inset), var(--rest);
  transition: background-color .7s var(--ease), box-shadow .7s var(--ease);
}
.card p { color: var(--muted); }
.card h3 + p, .card h2 + p { margin-top: 10px; }
.card > .btn { margin-top: 26px; }
.card-lift { box-shadow: var(--inset), var(--lift); }
.card-accent { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.card-accent p { color: var(--text); }
.card-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.card-row p { max-width: 58ch; }
.card-media { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card-body { padding: 24px clamp(24px, 3vw, 34px) 30px; display: grid; gap: 12px; align-content: start; }
.status { color: var(--accent) !important; font-weight: 650; font-size: .93rem; }

.reels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.reels a { display: block; text-decoration: none; }
.reels img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--r-l); box-shadow: var(--lift); }
.reel-title { display: block; margin-top: 14px; color: var(--ink); font-weight: 650; line-height: 1.3; }
.reel-meta { display: block; margin-top: 4px; color: var(--muted); font-size: .9rem; }
.reels a:hover .reel-title { color: var(--accent); }

.resources { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
.pair, .cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }

.give { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 52px); align-items: start; }
.give-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.give-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-m); }
.give-photos img:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; border-radius: var(--r-l); }
.give-copy { display: grid; gap: 30px; padding-top: 6px; }
.give-copy p { color: var(--muted); margin-top: 8px; }
.give-copy .text-link { display: inline-block; margin-top: 12px; }

.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.about-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-xl); box-shadow: var(--lift); }
.about-copy { display: grid; gap: 16px; }
.about-copy > p { max-width: 54ch; }
.quote { margin: 18px 0 0; padding-top: 22px; position: relative; }
.quote::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 4px; border-radius: 4px; background: var(--accent); }
.quote p { font-size: 1.35rem; line-height: 1.42; color: var(--ink); font-weight: 520; max-width: 40ch; }

.now { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 64px); }
.now .block-head { margin-bottom: 0; align-content: start; }
.now-list li { padding: 17px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 1.12rem; }
.now-list li:last-child { border-bottom: 1px solid var(--line); }

.result { color: var(--ink) !important; font-weight: 720; font-size: 1.4rem; font-stretch: 86%; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .82rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 5px 12px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.talk-photos { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; margin-bottom: 32px; }
.talk-photos img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-m); }
.talks li {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) 70px 90px;
  align-items: baseline; gap: 6px 20px; padding: 18px 0; border-top: 1px solid var(--line);
}
.talks li:last-child { border-bottom: 1px solid var(--line); }
.talk-event { color: var(--ink); font-weight: 650; }
.talk-topic, .talk-year { color: var(--muted); }
.talks .text-link { justify-self: end; }
.recognition { margin: 24px 0 0; color: var(--muted); }
.talk-years { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.talk-years li { background: var(--surface); border-radius: var(--r-l); padding: 24px 24px 26px; box-shadow: var(--inset), var(--rest); display: grid; gap: 6px; align-content: start; }
.ty-year { font-size: 2.4rem; font-weight: 750; font-stretch: 84%; color: var(--ink); line-height: 1; letter-spacing: -0.03em; }
.ty-count { color: var(--accent); font-weight: 650; }
.ty-bar { display: block; height: 8px; border-radius: 8px; margin: 6px 0 10px; background: linear-gradient(90deg, var(--accent) calc(var(--n) / 16 * 100%), var(--surface-2) 0); }
.talk-years p { color: var(--muted); font-size: .95rem; line-height: 1.45; }
.talk-thread { margin: 20px 0 0; }
.talks-head { margin: 52px 0 14px; }
@media (max-width: 900px) { .talk-years { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .talk-years { grid-template-columns: 1fr; } }
.talk-menu { margin: 44px 0 32px; }
.talk-menu h3 { margin-bottom: 14px; }
.talk-menu ul { columns: 2; column-gap: 40px; }
.talk-menu li { break-inside: avoid; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
@media (max-width: 760px) { .talk-menu ul { columns: 1; } }

.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.quotes figure { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.quotes blockquote { margin: 0; }
.quotes blockquote p { color: var(--ink); font-size: 1.12rem; line-height: 1.5; }
.quotes figcaption { font-weight: 650; color: var(--ink); }
.quotes figcaption span { display: block; font-weight: 400; color: var(--muted); font-size: .92rem; }

.contact { display: grid; gap: 14px; justify-items: start; }
.contact p { color: var(--muted); max-width: 48ch; }
.contact .btn { margin-top: 10px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }

.foot { margin-top: clamp(64px, 9vw, 120px); border-top: 1px solid var(--line); }
.foot-inner { display: grid; justify-items: start; gap: 20px; padding-top: 64px; padding-bottom: 48px; }
.foot-line { font-size: clamp(2rem, 2.6vw + 1rem, 3.1rem); font-weight: 700; font-stretch: 86%; color: var(--ink); line-height: 1.02; letter-spacing: -0.025em; max-width: 16ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; }
.foot-links a { color: var(--muted); text-decoration: none; font-weight: 550; }
.foot-links a:hover { color: var(--ink); }
.foot-small { color: var(--muted); font-size: .85rem; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .reels { grid-template-columns: repeat(4, minmax(220px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 28px; margin: -4px -4px 0; scrollbar-width: none; }
  .reels::-webkit-scrollbar { display: none; }
  .reels li { scroll-snap-align: start; }
  .quotes { grid-template-columns: 1fr; }
  .talk-photos { grid-template-columns: 1fr 1fr; }
  .talk-photos img:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .hero { height: auto; }
  #island { height: calc(var(--bar-h) + env(safe-area-inset-top, 0px) + 400px); bottom: auto; }
  .hero-inner { display: block; height: auto; padding-top: calc(var(--bar-h) + env(safe-area-inset-top, 0px) + 372px); padding-bottom: 56px; }
  .display { font-size: clamp(2.4rem, 9.5vw, 3.4rem); }
  .lede { margin-top: 14px; }
  .actions { margin-top: 22px; }
  .stats { margin-top: 26px; gap: 10px 28px; }
  .stats dd { font-size: 1.45rem; }
  .hint { left: 0; right: 0; bottom: auto; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px) + 6px); text-align: center; }
  .island-poster { width: 100%; right: 0; top: calc(var(--bar-h) + 10px); transform: none; }
  .resources, .pair, .cases, .give, .about, .now { grid-template-columns: 1fr; }
  .about-photo { aspect-ratio: 4 / 3; }
  .talks li { grid-template-columns: 1fr auto; }
  .talk-topic { grid-column: 1; }
  .talk-year { grid-column: 2; grid-row: 1; justify-self: end; }
  .talks .text-link { grid-column: 1; justify-self: start; }
}

@media (max-width: 560px) {
  .bar { grid-template-columns: 1fr auto; }
  .wordmark { display: none; }
  .switch { justify-self: start; }
  .switch-tab { padding: 11px 13px; font-size: .88rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
