/* Rimbula: a clean white product page in Andos's own colours and type (app/globals.css).
   Blue is the next action and what's done; orange is Ivy and what needs you; the rest is white and black at fixed strengths.
   A single light look by choice. */
:root {
  --bg: #ffffff;
  --bg-muted: #f3f3f3;
  --bg-home: #eef1f8;
  --line: #e7e7e7;
  --line-strong: #d6d6d6;
  --ink: #111111;
  --text: #545454;
  --dim: #6b6b6b;
  --action: #2a55a6;
  --action-hover: #244993;
  --done: #2a55a6;
  --wash-done: #eef1f8;
  --agent: #bb4e09;
  --agent-lit: #f9a14b;
  --wash-agent: #fdf5f0;
  --wash-agent-edge: #f9dcca;
  --mark: #f16a18;
  --board-dot: #e2ddd6;
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; border-radius: 4px; }
h1, h2 { color: var(--ink); margin: 0; text-wrap: balance; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 13px; }

.wrap {
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

/* Bar */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 11; background: var(--bg); }
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: rgb(255 255 255 / 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.glyph { width: 18px; height: 18px; border-radius: 5px; background: var(--mark); box-shadow: 0 2px 8px rgb(241 106 24 / 0.35); }
.bar nav { display: flex; align-items: center; gap: 24px; }
.bar nav a:not(.btn) { color: var(--text); text-decoration: none; }
.bar nav a:not(.btn):hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font: 600 15px/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { box-shadow: 0 0 0 4px rgb(17 17 17 / 0.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.btn-action { background: var(--action); color: #fff; }
.btn-action:hover { background: var(--action-hover); color: #fff; box-shadow: 0 0 0 4px rgb(42 85 166 / 0.15); }
.btn-line { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; border-radius: 7px; }

/* Arrival on load: things rise into place. */
.rise { animation: rise 0.7s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Hero, on Ivy's board of dots */
.hero { position: relative; padding-block: 88px 0; text-align: center; overflow-x: clip; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 680px; z-index: -1;
  background-image: radial-gradient(circle, var(--board-dot) 1.1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  animation: drift 40s linear infinite;
}
@keyframes drift { to { background-position: 22px 22px; } }
.tag { display: inline-flex; align-items: center; gap: 10px; color: var(--text); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--agent-lit); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(249 161 75 / 0.6); } 70%, 100% { box-shadow: 0 0 0 8px rgb(249 161 75 / 0); } }
.hero h1 { margin: 26px auto 0; max-width: 13em; font-size: clamp(42px, 7vw, 76px); font-weight: 600; line-height: 1; letter-spacing: -0.045em; }
.lead { margin: 24px auto 0; max-width: 36em; font-size: 19px; text-wrap: balance; }
.actions { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* The product window */
.app {
  margin: 64px 0 0; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); overflow: hidden;
  box-shadow: 0 1px 2px rgb(17 17 17 / 0.04), 0 40px 80px -40px rgb(17 17 17 / 0.25);
}
.app-bar { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--bg-muted); color: var(--dim); font-size: 12px; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.app-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; transition: background-color 0.3s, color 0.3s; }
.live[data-live="working"], .live[data-live="needs"] { background: var(--wash-agent); color: var(--agent); }
.live[data-live="done"] { background: var(--wash-done); color: var(--done); }
.live[data-live="done"] .pulse { background: var(--done); animation: none; }
.app-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); min-height: 560px; }
.chat { display: flex; flex-direction: column; gap: 12px; padding: 28px; border-right: 1px solid var(--line); }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg.ivy { align-self: flex-start; background: var(--wash-agent); border-bottom-left-radius: 4px; }
.typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 13px 14px; border-radius: 14px; border-bottom-left-radius: 4px; background: var(--wash-agent); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--agent-lit); animation: bounce 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.steps { list-style: none; margin: 4px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 9px; font-size: 12.5px; color: var(--text); }
.steps li { display: flex; gap: 10px; align-items: center; transition: color 0.3s; }
.steps li::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; line-height: 1; transition: background-color 0.3s, box-shadow 0.3s; }
.steps .todo { color: var(--line-strong); }
.steps .todo::before { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.steps .now { color: var(--ink); }
.steps .now::before { background: var(--done); box-shadow: 0 0 0 0 rgb(42 85 166 / 0.5); animation: ring 1.2s ease-out infinite; transform: scale(0.6); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgb(42 85 166 / 0.45); } 100% { box-shadow: 0 0 0 9px rgb(42 85 166 / 0); } }
.steps .done::before { content: "✓"; color: #fff; background: var(--done); font-weight: 700; }

.needs { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--wash-agent); box-shadow: inset 0 0 0 1px var(--wash-agent-edge); color: var(--ink); font-size: 14.5px; transition: background-color 0.4s, box-shadow 0.4s, opacity 0.4s; }
.needs .mono { color: var(--agent); font-size: 11.5px; }
.app.approved .needs { opacity: 0.5; }
.msg.after { display: none; }
.app.approved .msg.after { display: block; animation: rise 0.5s var(--ease) both; }

.post { padding: 28px; background: var(--bg-muted); display: flex; flex-direction: column; gap: 14px; }
.post-meta { width: 100%; max-width: 300px; margin: 0 auto; }
.post-art {
  position: relative; aspect-ratio: 4 / 5; width: 100%; max-width: 300px; margin: 0 auto; border-radius: 12px; overflow: hidden; display: grid; place-items: end start; padding: 16px;
  background:
    radial-gradient(circle at 72% 30%, #ffd28a 0 15%, transparent 15.5%),
    radial-gradient(circle at 58% 56%, #f59b5b 0 21%, transparent 21.5%),
    radial-gradient(circle at 32% 38%, #2f8f6b 0 13%, transparent 13.5%),
    linear-gradient(160deg, #fbe6d1, #f6c9a6 55%, #ef9f6b);
}
.post-art span { background: #111; color: #fff; font-weight: 600; font-size: 20px; letter-spacing: -0.02em; line-height: 1.1; padding: 9px 12px; border-radius: 6px; transition: opacity 0.4s 0.2s, transform 0.5s 0.2s var(--ease); }
.post-art em { position: absolute; top: 10px; right: 10px; font-style: normal; font-size: 11px; color: #5a3a22; background: rgb(255 255 255 / 0.7); padding: 2px 6px; border-radius: 4px; }
/* While Ivy makes the picture: a blank tile a light passes across. */
.post-art::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease);
  background: linear-gradient(100deg, #ececec 30%, #f8f8f8 50%, #ececec 70%) 0 0 / 260% 100%;
}
.post-art.making::after { opacity: 1; animation: sheen 1.4s linear infinite; }
.post-art.making span { opacity: 0; transform: translateY(8px); }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -160% 0; } }
.post-meta { display: grid; gap: 12px; transition: opacity 0.5s; }
.post-art.making + .post-meta { opacity: 0.35; }
.post-meta p { color: var(--ink); font-size: 14.5px; }
.post-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: var(--dim); font-size: 12px; }
.post-actions { display: flex; gap: 8px; }
.approve.press { transform: scale(0.94); background: var(--action-hover); }
.scheduled { display: none; padding: 9px 12px; border-radius: 8px; background: var(--wash-done); color: var(--done); font-size: 12.5px; }
.app.approved .post-actions { display: none; }
.app.approved .scheduled { display: block; animation: rise 0.5s var(--ease) both; }

/* The run's choreography: before its moment, a step waits out of sight. */
.seq { transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.seq.pre { opacity: 0; transform: translateY(8px); }
.gone { display: none !important; }

/* Sections */
section.system, section.spec, section.contact { padding-block: 104px; }
.system { border-bottom: 1px solid var(--line); }
.head { max-width: 560px; }
.kicker { display: block; color: var(--agent); margin-bottom: 12px; }
.head h2 { font-size: clamp(30px, 4vw, 40px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.head p { margin-top: 14px; font-size: 17px; }

/* The loop: a light walks the six stages in turn. */
.pipe { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pipe li { position: relative; padding: 22px 20px 24px; background: var(--bg); }
.pipe li::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--done); transform: scaleX(0); transform-origin: left;
  animation: walk 9s var(--ease) infinite; animation-delay: calc(var(--i) * 1.5s);
}
@keyframes walk { 0% { transform: scaleX(0); } 8% { transform: scaleX(1); } 16% { transform: scaleX(1); opacity: 1; } 22%, 100% { transform: scaleX(1); opacity: 0; } }
.pipe li + li { border-left: 1px solid var(--line); }
.pipe li + li::before {
  content: ""; position: absolute; left: -6px; top: 28px; width: 10px; height: 10px; background: var(--bg);
  border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); transform: rotate(45deg);
}
.pipe .n { display: inline-block; color: var(--done); background: var(--wash-done); border-radius: 5px; padding: 2px 7px; font-size: 12px; }
.pipe li:nth-child(5) .n { color: var(--agent); background: var(--wash-agent); }
.pipe b { display: block; margin: 14px 0 6px; color: var(--ink); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.pipe p { font-size: 14px; line-height: 1.55; }

.spec { background: var(--bg-home); border-bottom: 1px solid var(--line); }
.spec-grid, .contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; align-items: start; }
.sheet { margin: 0; border-top: 1px solid var(--line-strong); }
.sheet div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line-strong); }
.spec .sheet div { border-bottom-color: rgb(17 17 17 / 0.08); }
.sheet dt { color: var(--dim); padding-top: 2px; }
.sheet dd { margin: 0; color: var(--ink); }
.sheet dd a { color: var(--action); text-decoration: none; }
.sheet dd a:hover { text-decoration: underline; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 24px 32px; color: var(--dim); }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 12.5px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Legal pages */
.doc { padding-block: 72px 96px; }
.doc .narrow { max-width: 760px; }
.doc .crumb { color: var(--dim); margin-bottom: 18px; }
.doc .crumb a { color: var(--dim); text-decoration: none; }
.doc .crumb a:hover { color: var(--ink); }
.doc h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 600; line-height: 1.08; letter-spacing: -0.035em; }
.doc .meta { margin: 14px 0 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 14px; }
.doc h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 44px 0 12px; }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 14px; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--dim); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--action); }
.table-wrap { overflow-x: auto; margin: 6px 0 14px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.doc th { font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--dim); }
.doc td:first-child { color: var(--ink); width: 38%; }

/* Tablet */
@media (max-width: 960px) {
  .pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipe li:nth-child(4) { border-left: 0; }
  .pipe li:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .pipe li:nth-child(4)::before { display: none; }
}

@media (max-width: 860px) {
  .app-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .chat { border-right: 0; border-bottom: 1px solid var(--line); min-height: 470px; }
  .spec-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* Phone */
@media (max-width: 560px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .hide-sm { display: none; }
  .hero { padding-top: 56px; }
  .lead { font-size: 17px; }
  .app { margin-top: 44px; }
  .app-title { display: none; }
  .live { margin-left: auto; }
  .chat, .post { padding: 18px; }
  .chat { min-height: 500px; }
  section.system, section.spec, section.contact { padding-block: 72px; }
  .pipe { grid-template-columns: minmax(0, 1fr); }
  .pipe li + li { border-left: 0; border-top: 1px solid var(--line); }
  .pipe li + li::before, .pipe li:nth-child(4)::before { left: 24px; top: -6px; transform: rotate(135deg); display: block; }
  .sheet div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .doc { padding-block: 48px 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .hero::before, .pulse, .typing i, .pipe li::after, .steps .now::before { animation: none; }
}
