/* Agent Office — one-viewport hero. No external fonts or assets. */
:root {
  --bg: #0b0d12;
  --text: #f4f1ec;
  --muted: #a8a39c;
  --dim: #6c6862;
  --accent: #f2b766;
  --accent-2: #e07a3c;
  --line: rgba(242, 183, 102, .42);
  --line-soft: rgba(255, 220, 180, .13);
  --eye: #4df2d8;
  --needs: #ff5a5f;
  --turn: #7fb2ff;
  --idle: #7c858b;
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter Display", Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --dock-bottom: max(28px, env(safe-area-inset-bottom));
  --dock-h: 52px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; height: 100svh; overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .9em; }
::selection { background: rgba(242, 183, 102, .35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── atmosphere ───────── */
.atmo {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(120% 95% at 50% 60%, #1d1e27 0%, #121319 48%, #08090c 100%);
}
.band { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.b1 { width: 95vw; height: 24vw; left: -26vw; top: 50vh; background: rgba(224, 130, 60, .2); rotate: -16deg; animation: drift 26s ease-in-out infinite alternate; }
.b2 { width: 70vw; height: 20vw; right: -20vw; top: 60vh; background: rgba(77, 200, 190, .1); rotate: 12deg; animation: drift 32s ease-in-out infinite alternate-reverse; }
.b3 { width: 90vw; height: 44vh; left: 6vw; top: -20vh; background: rgba(86, 80, 150, .2); animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(5vw, 4vh, 0) scale(1.08); } }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse 85% 80% at 50% 48%, transparent 45%, rgba(3, 3, 5, .65) 100%); }
.grain {
  position: absolute; inset: -50%; opacity: .06; mix-blend-mode: overlay;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────── hero ───────── */
.hero {
  position: relative; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(36px, 8vh, 100px) 16px 0; text-align: center;
}
h1 {
  position: relative; z-index: 1; margin: 0; max-width: 100%;
  font: 500 clamp(30px, min(4.3vw, 7.4vh), 68px)/1.04 var(--display);
  letter-spacing: -.045em; text-wrap: balance;
}
h1 span { display: block; }
h1 .warm {
  padding-bottom: .06em;
  background: linear-gradient(100deg, #fbe3c4, var(--accent) 50%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* clone box under the headline */
.clone { position: relative; z-index: 1; width: min(740px, 100%); margin-top: clamp(22px, 5vh, 54px); }
.clone-box {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 5px 5px 5px 22px;
  border: 1.5px solid var(--line); border-radius: 99px; background: rgba(16, 14, 12, .5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px -24px rgba(0, 0, 0, .9);
  transition: border-color .3s, box-shadow .3s;
}
.clone-box:hover, .clone-box:focus-within { border-color: var(--accent); }
.clone-box code { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow-x: auto; scrollbar-width: none; font-size: 14.5px; }
.clone-box code::-webkit-scrollbar { display: none; }
.clone-box [data-repo-url] { color: var(--accent); }
.prompt { color: var(--dim); user-select: none; margin-right: 4px; }
.copy {
  flex: none; height: 100%; padding: 0 20px; border: 0; border-radius: 99px; cursor: pointer; color: #1c0e03;
  background: linear-gradient(90deg, #ffd9a0, var(--accent) 45%, var(--accent-2));
  font: 600 13.5px var(--mono); text-transform: uppercase; letter-spacing: .02em;
  transition: filter .2s, transform .15s, background .2s;
}
.copy:hover { filter: brightness(1.08); }
.copy:active { transform: scale(.97); }
.copy.done { background: var(--accent-2); color: #1c0e03; }
.then { margin: 12px 0 0; font-size: 13px; color: var(--dim); }
.then code { color: var(--muted); }

/* ───────── robot ───────── */
.stage {
  --led: #ffd9a8;
  position: absolute; left: 50%; bottom: 0; translate: -50% 0;
  height: min(64svh, 104vw); aspect-ratio: 800 / 560;
  padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.stage:focus-visible { outline: none; }
.stage:focus-visible .bubble { outline: 2px solid var(--accent); outline-offset: 3px; }
.stage[data-state="working"] { --led: var(--eye); }
.stage[data-state="needs"] { --led: var(--needs); }
.stage[data-state="turn"] { --led: var(--turn); }
.stage[data-state="idle"] { --led: var(--idle); }
.stage::before {
  content: ""; position: absolute; left: 50%; top: 34%; width: 80%; aspect-ratio: 1; translate: -50% -50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--led) 20%, transparent), transparent 62%);
  filter: blur(30px); pointer-events: none; transition: opacity .4s;
}
.stage[data-state="idle"]::before { opacity: .45; }
#robot { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }

/* LEDs: ears, chest ring and the lit face all take the state colour */
#robot .r-led { stroke: var(--led); transition: stroke .35s; animation: led 3.6s ease-in-out infinite; }
#robot .eyes { fill: var(--led); stroke: var(--led); transition: fill .35s, stroke .35s; }
#robot .eyes rect { stroke: none; }
#robot .line path { fill: none; stroke-linecap: round; }
#robot .f-joy path { stroke-width: 13; }
#robot .f-mouth path { stroke-width: 7; }
#robot .f-smile path { stroke-width: 8; }
@keyframes led { 50% { opacity: .55; } }

/* which face shows per state */
#robot .fp { opacity: 0; transition: opacity .18s; }
[data-state="watch"] #robot .f-open, [data-state="watch"] #robot .f-mouth,
[data-state="working"] #robot .f-work,
[data-state="needs"] #robot .f-alert,
[data-state="turn"] #robot .f-joy, [data-state="turn"] #robot .f-smile,
[data-state="idle"] #robot .f-sleep { opacity: 1; }
#robot.happy .fp { opacity: 0; }
#robot.happy .f-joy, #robot.happy .f-smile { opacity: 1; }

#robot .lids { transform-box: fill-box; transform-origin: center; transition: transform .08s ease-out; }
#robot.squint .lids { transform: scaleY(.55); }
#robot.blink .lids { transform: scaleY(.08); }

/* working: lines being typed under the eyes */
#robot .type { transform-box: fill-box; transform-origin: left center; animation: type 1.4s steps(5, end) infinite; }
#robot .t2 { animation-delay: .35s; }
#robot .t3 { animation-delay: .7s; }
@keyframes type { 0% { transform: scaleX(0); } 70%, 100% { transform: scaleX(1); } }
[data-state="working"] #robot .r-led { animation-duration: 1.2s; }
/* needs you: flashing ! and LEDs */
#robot .f-alert rect, [data-state="needs"] #robot .r-led { animation: flash .7s steps(1) infinite; }
@keyframes flash { 50% { opacity: .25; } }
/* idle: dim, slow, zzz */
[data-state="idle"] #robot .r-led { animation-duration: 6s; }
#robot .zzz { fill: var(--led); font: 700 30px var(--mono); opacity: 0; transition: opacity .3s; }
[data-state="idle"] #robot .zzz { opacity: 1; }
#robot .zzz text { animation: zzz 3s ease-in-out infinite; }
#robot .zzz text:nth-child(2) { animation-delay: .5s; font-size: 36px; }
#robot .zzz text:nth-child(3) { animation-delay: 1s; font-size: 44px; }
@keyframes zzz { 0% { opacity: 0; transform: translateY(14px); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }

/* speech bubble next to the head */
.bubble {
  position: absolute; left: 71%; top: 2%; z-index: 1;
  display: flex; flex-direction: column; gap: 3px; padding: 10px 14px 11px; min-width: 120px;
  border-radius: 12px 12px 12px 3px; text-align: left; white-space: nowrap;
  background: rgba(14, 14, 18, .82); border: 1px solid color-mix(in srgb, var(--led) 45%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .8), 0 0 30px -10px color-mix(in srgb, var(--led) 50%, transparent);
  opacity: 0; transform: translateY(6px) scale(.96); transform-origin: left bottom;
  transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1), border-color .35s;
  pointer-events: none;
}
.bubble.show { opacity: 1; transform: none; }
.b-kicker { display: flex; align-items: center; gap: 7px; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--led); transition: color .35s; }
.b-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--led); box-shadow: 0 0 10px var(--led); }
.b-text { font: 500 14px var(--mono); color: var(--text); }

/* ───────── dock ───────── */
.dock {
  position: fixed; left: 50%; bottom: var(--dock-bottom); translate: -50% 0; z-index: 6;
  display: flex; align-items: stretch; gap: 2px; height: var(--dock-h); padding: 4px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(10, 10, 13, .55), rgba(10, 10, 13, .9) 40%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .85);
}
.dock-btn {
  width: 58px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 7px; background: transparent; cursor: pointer; transition: background .2s;
}
.dock-btn:hover, .dock-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .07); }
.dock-btn svg { width: 30px; height: 30px; }
.dock-btn .o { fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; }
.dock-btn .f { fill: #fff; }
.cta {
  padding: 0 24px; border: 0; border-radius: 7px; cursor: pointer; color: #1c0e03;
  background: linear-gradient(90deg, #ffd9a0, var(--accent) 40%, var(--accent-2));
  font: 600 15.5px var(--mono); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
  transition: filter .2s, transform .15s;
}
.cta:hover { filter: brightness(1.08) saturate(1.1); }
.cta:active { transform: scale(.98); }
.cta { display: inline-flex; align-items: center; gap: 10px; }
.cta svg { width: 14px; height: 14px; fill: currentColor; }

/* ───────── demo video overlay ───────── */
/* the page recedes a little behind the blur, which gives the video depth */
.hero { transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .6s; transform-origin: 50% 65%; }
body.demo-open .hero { transform: scale(.94); filter: saturate(.8) brightness(.85); }

.demo {
  width: min(1120px, calc(100vw - 32px), calc((100svh - 150px) * 16 / 9));
  max-width: none; max-height: none; padding: 0; border: 0; overflow: visible;
  background: transparent; color: var(--text);
}
.demo::backdrop {
  background: radial-gradient(ellipse at 50% 50%, rgba(20, 16, 14, .35), rgba(4, 4, 6, .72));
  backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1);
}
.demo video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000;
  border-radius: 16px; border: 1px solid var(--line-soft);
  box-shadow: 0 60px 160px -30px rgba(0, 0, 0, .95), 0 0 140px -40px rgba(242, 183, 102, .4);
}
.demo-close {
  position: absolute; right: 0; bottom: calc(100% + 14px);
  width: 42px; height: 42px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 50%; background: rgba(16, 14, 12, .6);
  transition: border-color .2s, background .2s;
}
.demo-close:hover { border-color: var(--accent); background: rgba(242, 183, 102, .12); }
.demo-close svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.demo[open] { animation: demo-in .5s cubic-bezier(.2, .8, .2, 1); }
.demo[open]::backdrop { animation: fade-in .35s ease; }
.demo.closing { animation: demo-out .22s ease forwards; }
.demo.closing::backdrop { animation: fade-out .22s ease forwards; }
@keyframes demo-in { from { opacity: 0; transform: translateY(28px) scale(.93); } }
@keyframes demo-out { to { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }


/* ───────── panel ───────── */
.panel {
  position: fixed; left: 50%; z-index: 5; translate: -50% 0;
  bottom: calc(var(--dock-bottom) + var(--dock-h) + 14px);
  width: min(460px, 100vw - 32px); max-height: calc(100svh - var(--dock-bottom) - var(--dock-h) - 40px); overflow-y: auto;
  padding: 22px; border-radius: 16px; text-align: left;
  background: rgba(13, 13, 17, .84); border: 1px solid var(--line-soft);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .85);
  opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none;
  transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.panel.open { opacity: 1; transform: none; pointer-events: auto; }
.kicker { margin: 0 0 8px; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.panel h2 { margin: 0; font: 500 22px/1.15 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.panel p { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; }
.panel img { width: 100%; max-height: 24svh; object-fit: cover; margin-top: 16px; border-radius: 10px; border: 1px solid var(--line-soft); }
.states, .checks, .menu { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; color: var(--muted); }
.states { gap: 2px; margin-top: 10px; }
.states li { --c: var(--eye); }
.states li[data-s="needs"] { --c: var(--needs); }
.states li[data-s="turn"] { --c: var(--turn); }
.states li[data-s="idle"] { --c: var(--idle); }
.states button {
  display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 6px 8px; margin: 0 -8px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; color: var(--muted);
}
.states button:hover, .states button[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 10%, transparent); }
.states button::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); translate: 0 -1px; }
.states b { color: var(--text); font-weight: 600; }
.checks li { position: relative; padding-left: 24px; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--eye); font-weight: 700; }

.menu { gap: 2px; margin: 0; }
.menu button, .menu a {
  display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left;
  font: 500 14.5px var(--mono); text-transform: uppercase; letter-spacing: .02em; color: var(--text);
}
.menu button:hover, .menu a:hover { background: rgba(255, 255, 255, .06); }
.fine { font-size: 12.5px !important; color: var(--dim) !important; padding: 0 12px; }

/* ───────── coffee (donate €2,99) ───────── */
.dock-btn .steam { stroke-width: 1.7; opacity: .7; animation: steam 2.8s ease-in-out infinite; }
.dock-btn .steam + .steam { animation-delay: .4s; }
@keyframes steam { 0%, 100% { opacity: .25; transform: translateY(1px); } 50% { opacity: .8; transform: translateY(-1px); } }
.coffee-btn {
  display: flex; align-items: center; gap: 12px; height: 52px; margin-top: 18px; padding: 0 6px 0 18px;
  border-radius: 99px; color: #1c0e03;
  background: linear-gradient(90deg, #ffd9a0, var(--accent) 45%, var(--accent-2));
  font: 600 14.5px var(--mono); text-transform: uppercase; letter-spacing: .02em;
  box-shadow: 0 18px 40px -18px rgba(224, 122, 60, .7);
  transition: filter .2s, transform .15s;
}
.coffee-btn:hover { filter: brightness(1.08) saturate(1.1); }
.coffee-btn:active { transform: scale(.98); }
.coffee-btn[aria-disabled="true"] { opacity: .5; filter: grayscale(.4); cursor: not-allowed; transform: none; }
.coffee-btn svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.coffee-btn .price {
  margin-left: auto; height: 40px; display: grid; place-items: center; padding: 0 16px;
  border-radius: 99px; background: rgba(28, 14, 3, .88); color: var(--accent); letter-spacing: 0;
}
.panel .fine-note { margin-top: 10px; font-size: 12.5px; color: var(--dim); text-align: center; }

/* ───────── small screens ───────── */
@media (max-width: 640px) {
  :root { --dock-bottom: max(16px, env(safe-area-inset-bottom)); --dock-h: 48px; }
  .clone-box { height: 46px; padding-left: 16px; }
  .clone-box code { font-size: 12.5px; }
  .copy { padding: 0 14px; font-size: 12.5px; }
  .dock-btn { width: 44px; }
  .cta { padding: 0 16px; font-size: 14px; }
  /* not enough room beside the head: put the bubble above it */
  .bubble { left: 50%; top: 0; translate: -50% -85%; border-radius: 12px; transform-origin: center bottom; }
}

/* short screens: keep the robot clear of the clone box */
@media (max-height: 760px) { .then { display: none; } }

/* ───────── entrance ───────── */
h1 span, .clone, .dock { animation: rise 1s cubic-bezier(.2, .7, .2, 1) both; }
h1 span:nth-child(2) { animation-delay: .08s; }
.clone { animation-delay: .2s; }
.stage { animation: rise-robot 1.4s cubic-bezier(.2, .7, .2, 1) .15s both; }
.dock { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes rise-robot { from { opacity: 0; transform: translateY(60px); } }

@media (prefers-reduced-motion: reduce) {
  .band, h1 span, .clone, .stage, .dock,
  #robot .r-led, #robot .type, #robot .f-alert rect, #robot .zzz text, .dock-btn .steam { animation: none !important; }
  .panel { transition: opacity .15s; transform: none; }
  .demo[open], .demo[open]::backdrop { animation: none; }
  .hero { transition: none; }
  body.demo-open .hero { transform: none; }
}
