/* 129ideas.com — an ancient tree on a beach; scrolling walks into the screen grown into its trunk. */

@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-latin-400-normal.woff2?v=5") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-latin-400-italic.woff2?v=5") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken-grotesk-latin-wght-normal.woff2?v=5") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --ink: #1d1a14;        /* bark-dark text */
  --bark: #3b2f24;
  --leaf: #1f3b27;
  --sea: #1e8c8a;
  --sea-deep: #0f5f63;
  --sand: #ead2a6;
  --sky: #f6dcbd;
  --paper: #f8eee0;
  --glass: rgba(18, 15, 12, 0.86);
  --glass-line: rgba(255, 236, 205, 0.14);
  --screen-ink: #f5ead8;
  --muted: #6c5f50;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.5; }
img { max-width: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 clamp(16px, 3vw, 36px);
  transition: background-color .3s, backdrop-filter .3s, color .3s;
}
.bar.solid { background: rgba(248, 238, 224, 0.82); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.bar.on-screen { color: var(--screen-ink); background: rgba(14, 12, 10, 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.bar.in-tree { color: var(--screen-ink); background: linear-gradient(rgba(14, 12, 10, .5), rgba(14, 12, 10, 0)); }
.bar.on-screen .brand img, .bar.in-tree .brand img { filter: invert(1) brightness(1.6); }
.bar.in-tree .lang button[aria-pressed="true"] { color: var(--ink); background: var(--screen-ink); }
.bar.in-tree .pill { background: var(--screen-ink); color: var(--ink); }
.brand { display: inline-flex; justify-self: start; }
.brand img { height: 40px; width: auto; display: block; transition: filter .3s; }
.nav { display: flex; gap: clamp(14px, 2.2vw, 30px); }
.nav a, .mobile-nav a { text-decoration: none; font-size: 15px; font-weight: 500; letter-spacing: .005em; }
.nav a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.bar-end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; border: 1px solid currentColor; border-radius: 999px; padding: 2px; opacity: .85; }
.lang button { font: 600 12px/1 var(--sans); color: inherit; background: none; border: 0; border-radius: 999px; padding: 6px 9px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: currentColor; }
.lang button[aria-pressed="true"] { color: var(--paper); background: var(--ink); }
.bar.on-screen .lang button[aria-pressed="true"] { color: var(--ink); background: var(--screen-ink); }
.pill { text-decoration: none; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.bar.on-screen .pill { background: var(--screen-ink); color: var(--ink); }
.menu-btn { display: none; width: 40px; height: 40px; border: 0; background: none; color: inherit; cursor: pointer; position: relative; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { position: absolute; left: 10px; width: 20px; height: 2px; background: currentColor; content: ""; border-radius: 2px; }
.menu-btn span { top: 19px; } .menu-btn span::before { top: -6px; left: 0; } .menu-btn span::after { top: 6px; left: 0; }
.mobile-nav { position: fixed; z-index: 29; inset: var(--bar-h) 12px auto 12px; background: var(--paper); border-radius: 16px; padding: 10px; box-shadow: 0 20px 50px rgba(29, 26, 20, .25); display: grid; }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { padding: 12px 14px; border-radius: 10px; }
.mobile-nav a:hover { background: var(--sky); }

@media (max-width: 900px) {
  .bar { grid-template-columns: auto 1fr; }
  .nav, .pill { display: none; }
  .menu-btn { display: inline-block; }
}

/* ---------- the tree ---------- */
.tree { position: relative; height: 380vh; height: 380svh; background: #f3c99a; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.layer { position: absolute; left: 0; top: 0; width: 2576px; height: 1438px; transform-origin: 0 0; will-change: transform; backface-visibility: hidden; user-select: none; -webkit-user-drag: none; }
.layer.close, .layer.mid {
  opacity: 0;
  /* soft edges: the outer part of each sharper photo fades into the one behind it */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16%, #000 84%, transparent), linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 16%, #000 84%, transparent), linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  mask-composite: intersect;
}
.dim { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(14, 12, 10, .55), rgba(14, 12, 10, .85)); opacity: 0; pointer-events: none; }

.hero { z-index: 2; isolation: isolate; position: absolute; inset: calc(var(--bar-h) + clamp(28px, 10vh, 110px)) 0 auto 0; text-align: center; padding: 0 20px; pointer-events: none; will-change: opacity, transform; }
.tagline {
  font-family: var(--serif); font-weight: 400; margin: 0 auto; max-width: 14ch;
  font-size: clamp(36px, min(7.4vw, 10.5vh), 112px); line-height: .98; letter-spacing: -.012em; color: #fff7ea;
  text-shadow: 0 2px 24px rgba(10, 20, 12, .65), 0 0 2px rgba(10, 20, 12, .4);
}
.tagline em { font-style: italic; }
.sub { margin: clamp(6px, 1.6vh, 14px) auto 0; max-width: 34ch; font-size: clamp(16px, 1.35vw, 19px); font-weight: 500; color: #fff3e0; text-shadow: 0 1px 14px rgba(10, 20, 12, .9), 0 0 2px rgba(10, 20, 12, .6); }
.cue { margin-top: clamp(8px, 2vh, 18px); font-size: 13px; font-weight: 600; letter-spacing: .02em; color: #fff3e0; text-shadow: 0 1px 10px rgba(10, 20, 12, .9); }
.hero::before { content: ""; position: absolute; inset: -40px 10% -10px; z-index: -1; background: radial-gradient(ellipse at 50% 45%, rgba(12, 22, 14, .42), transparent 68%); pointer-events: none; }
.cue span::after { content: ""; display: block; width: 1px; height: 28px; margin: 8px auto 0; background: currentColor; transform-origin: top; animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: scaleY(.3); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cue span::after { animation: none; } }

/* the screen in the trunk: JS places it exactly over the opening, then opens it to almost full screen */
.screen {
  position: absolute; left: 0; top: 0; width: 200px; height: 120px;
  border-radius: 10px; overflow: hidden; background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 0 0 1px rgba(0, 0, 0, .35);
  container-type: size; color: var(--screen-ink); outline: none;
}
.screen-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 120%, rgba(30, 140, 138, .55), transparent 60%), radial-gradient(ellipse at 10% -20%, rgba(246, 190, 120, .35), transparent 55%);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .screen-glow { animation: none; } }
.screen-ui { position: relative; height: 100%; display: flex; flex-direction: column; padding: clamp(14px, 3.2cqh, 32px) clamp(14px, 3cqw, 40px); opacity: 0; visibility: hidden; }
.screen.live .screen-ui { visibility: visible; }
.screen-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: clamp(10px, 3cqh, 28px); }
.screen-title { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 4.6cqh, 46px); margin: 0; letter-spacing: -.01em; }
.tabs { display: inline-flex; gap: 4px; background: rgba(255, 236, 205, .08); border-radius: 999px; padding: 3px; }
.tabs button { font: 600 13px/1 var(--sans); color: var(--screen-ink); opacity: .75; background: none; border: 0; padding: 8px 13px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { opacity: 1; background: rgba(255, 236, 205, .16); }

.apps {
  list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center;
  gap: clamp(8px, 3cqh, 30px) clamp(4px, 1.6cqw, 22px);
  max-width: 1040px; margin: 0 auto; width: 100%;
}
.app { position: relative; display: flex; justify-content: center; flex: 0 0 clamp(100px, 17cqw, 180px); }
.app[hidden] { display: none; }
.app-btn {
  display: grid; justify-items: center; gap: 8px; width: 100%; padding: 10px 4px; border: 0; background: none; color: inherit; cursor: pointer;
  font: inherit; border-radius: 16px; transition: background-color .2s;
}
.app-btn img { width: clamp(56px, 10.5cqh, 104px); height: auto; aspect-ratio: 1; border-radius: 23%; box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
.app:hover .app-btn img, .app.open .app-btn img, .app-btn:focus-visible img { transform: translateY(-4px) scale(1.04); box-shadow: 0 16px 40px rgba(0, 0, 0, .5), 0 0 0 2px var(--c); }
.app-name { font-weight: 650; font-size: 15px; line-height: 1.15; }
.app-status { font-size: 12px; opacity: .72; text-align: center; line-height: 1.3; }
.app-status::before { content: ""; display: inline-block; vertical-align: 1px; margin-right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #9c9184; }
.app[data-status="live"] .app-status::before, .app[data-status="live-apps"] .app-status::before { background: #5fd3a4; box-shadow: 0 0 8px #5fd3a4; }
.app[data-status="dev"] .app-status::before { background: #f2b866; }

/* "Build your idea": an empty icon with a dashed edge and a plus, the last tile on the screen */
.app.build .app-btn { text-decoration: none; }
.app.build .plus {
  position: relative; display: block; width: clamp(56px, 10.5cqh, 104px); aspect-ratio: 1; border-radius: 23%;
  border: 2px dashed rgba(245, 234, 216, .55); background: rgba(255, 236, 205, .06);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .25s, background-color .25s;
}
.app.build .plus::before, .app.build .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34%; height: 3px; border-radius: 2px; background: var(--screen-ink); translate: -50% -50%; }
.app.build .plus::after { rotate: 90deg; }
.app.build:hover .plus, .app.build .app-btn:focus-visible .plus { transform: translateY(-4px) scale(1.04); border-color: var(--screen-ink); background: rgba(30, 140, 138, .28); }
.app.build .app-status::before { display: none; }

/* the card that opens on hover, focus or tap */
.card {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 50%; width: min(290px, 80cqw);
  translate: -50% 0; padding: 16px; border-radius: 16px; text-align: left;
  background: #f8eee0; color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  border-top: 4px solid var(--c);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
.app.flip .card { top: auto; bottom: calc(100% - 4px); transform: translateY(-6px); }
.app.edge-l .card { left: 0; translate: 0 0; }
.app.edge-r .card { left: auto; right: 0; translate: 0 0; }
@media (hover: hover) { .app:hover .card { opacity: 1; visibility: visible; transform: none; } }
.app.open .card, .app:focus-within .card { opacity: 1; visibility: visible; transform: none; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.card p { margin: 0 0 12px; font-size: 14px; color: #463b2f; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a, .links span { font-size: 13px; font-weight: 600; padding: 7px 11px; border-radius: 999px; text-decoration: none; border: 1px solid rgba(29, 26, 20, .18); }
.links a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.links .primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.links .soon { color: #8a7c6b; border-style: dashed; }

/* ---------- chapters ---------- */
.chapter { max-width: 1120px; margin: 0 auto; padding: clamp(80px, 14vh, 150px) clamp(20px, 5vw, 48px); border-top: 1px solid rgba(29, 26, 20, .12); }
.chapter:first-of-type { border-top: 0; }
.kicker { margin: 0 0 18px; font-weight: 650; font-size: 14px; color: var(--sea-deep); }
.statement { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5.4vw, 76px); line-height: 1.02; letter-spacing: -.012em; margin: 0 0 26px; max-width: 18ch; }
.body { font-size: clamp(17px, 1.4vw, 20px); max-width: 58ch; margin: 0 0 14px; color: #3a3026; }
.link { color: var(--sea-deep); font-weight: 600; text-underline-offset: 4px; }

.foot { display: grid; justify-items: center; gap: 4px; padding: 48px 20px 64px; font-size: 14px; color: var(--muted); text-align: center; background: var(--sand); }
.foot img { height: 40px; width: auto; opacity: .85; margin-bottom: 6px; }
.foot p { margin: 0; }

/* ---------- without the scroll animation (no JS, or reduced motion): a still scene, then the screen ---------- */
html:not(.js) .tree, html.reduce .tree { height: auto; }
html:not(.js) .stage, html.reduce .stage { position: relative; height: auto; overflow: visible; }
html:not(.js) .layer, html.reduce .layer { position: static; width: 100%; height: auto; }
html:not(.js) .layer.sea, html.reduce .layer.sea, html:not(.js) .layer.close, html.reduce .layer.close, html:not(.js) .layer.mid, html.reduce .layer.mid { display: none; }
html:not(.js) .hero, html.reduce .hero { position: static; padding: calc(var(--bar-h) + 24px) 20px 24px; }
html:not(.js) .cue, html.reduce .cue { display: none; }
html:not(.js) .screen, html.reduce .screen { position: relative; width: auto; height: auto; margin: 24px clamp(12px, 3vw, 40px) 40px; container-type: inline-size; }
html:not(.js) .screen-ui, html.reduce .screen-ui { opacity: 1; visibility: visible; }
html:not(.js) .apps, html.reduce .apps { padding: 8px 0 120px; }
html:not(.js) .dim, html.reduce .dim { display: none; }

/* short windows: keep the words clear of the screen */
@media (max-height: 560px) { .cue { display: none; } }
