/* this is Mi. The palette is MIStyle in the app's Design.swift: paper, ink,
   accent (cherry) and the three model tints, each with its dark-mode pair. */
:root {
  --paper: #faf5ed;
  --paper-2: #f3ebdf;
  --ink: #301f21;
  --muted: #7a6666;
  --accent: #ca172e;
  --bubble: #f6e3de;
  --line: rgba(48, 31, 33, .12);
  --spark: #ca172e;
  --flow: #265ca3;
  --galaxy: #6b42a1;
  --under: #191416;
  --under-ink: #f8f0e9;
  --under-muted: #bba8ab;
  --under-accent: #f15b70;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191416;
    --paper-2: #221b1d;
    --ink: #f8f0e9;
    --muted: #bba8ab;
    --accent: #f15b70;
    --bubble: #3a2a2d;
    --line: rgba(248, 240, 233, .14);
    --spark: #f15b70;
    --flow: #83afe9;
    --galaxy: #ba98ec;
    --under: #0f0b0c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
code { white-space: nowrap; font: .92em var(--mono); background: var(--paper-2); padding: .08em .35em; border-radius: 6px; }
h1, h2, h3 { font-weight: 500; line-height: 1.1; margin: 0; }
h2 { font: 500 clamp(2rem, 5vw, 3rem)/1.05 var(--serif); letter-spacing: -.01em; margin-bottom: 1rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: .35rem; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
section { padding: clamp(4rem, 10vw, 7rem) 0; }
.kicker { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .75rem; }
.intro { font-size: 1.15rem; color: var(--muted); max-width: 38rem; margin: 0 0 2.5rem; }

/* Hero: the page opens as a conversation */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 3rem; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.mark { width: 88px; height: 88px; color: var(--accent); margin-bottom: 1.5rem; }
h1 { font: 400 clamp(3.2rem, 9vw, 5.5rem)/.95 var(--serif); letter-spacing: -.035em; }
.tagline { font: italic 1.35rem/1.3 var(--serif); color: var(--muted); margin: .9rem 0 1.5rem; }
.lede { max-width: 28rem; margin: 0 0 2rem; }
.status {
  display: inline-flex; align-items: center; gap: .6rem; margin: 0;
  padding: .75rem 1.25rem; border-radius: 999px;
  background: var(--accent); color: var(--paper); font-weight: 600;
}
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; animation: pulse 2.4s ease-in-out infinite; }
.note { font-size: .88rem; color: var(--muted); margin: .8rem 0 0 .25rem; }

.chat {
  display: flex; flex-direction: column; gap: .65rem;
  padding: 1.75rem 1.5rem 1.25rem; border-radius: 34px;
  background: var(--paper-2); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(48, 31, 33, .35);
  max-width: 420px; justify-self: end; width: 100%;
}
.chat p { margin: 0; }
.chat .mi { max-width: 92%; }
.chat .you {
  align-self: flex-end; background: var(--bubble);
  padding: .45rem 1rem; border-radius: 20px;
}
.composer {
  margin-top: .75rem !important; padding: .7rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--paper);
}

/* Word-by-word reveal, as every reply does in the app */
.say span { --i: 0; }
.say span:nth-child(2) { --i: 1; } .say span:nth-child(3) { --i: 2; } .say span:nth-child(4) { --i: 3; }
.say span:nth-child(5) { --i: 4; } .say span:nth-child(6) { --i: 5; } .say span:nth-child(7) { --i: 6; }
.say span:nth-child(8) { --i: 7; } .say span:nth-child(9) { --i: 8; } .say span:nth-child(10) { --i: 9; }
.say span:nth-child(11) { --i: 10; } .say span:nth-child(12) { --i: 11; } .say span:nth-child(13) { --i: 12; }
.say span:nth-child(14) { --i: 13; } .say span:nth-child(15) { --i: 14; } .say span:nth-child(16) { --i: 15; }
.say span:nth-child(17) { --i: 16; }
.s1 { --t: .4s; } .s2 { --t: 1.3s; } .s3 { --t: 1.8s; } .s4 { --t: 2.3s; } .s5 { --t: 2.8s; }
.s6 { --t: 3.3s; } .s7 { --t: 3.8s; } .s8 { --t: 4.6s; } .s9 { --t: 6.3s; } .s10 { --t: 7s; }

@media (prefers-reduced-motion: no-preference) {
  .say span { opacity: 0; animation: word .35s ease-out forwards; animation-delay: calc(var(--t) + var(--i) * 80ms); }
  .chat .you, .composer { opacity: 0; animation: bubble .4s ease-out forwards; animation-delay: var(--t); }
}
@keyframes word { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
@keyframes bubble { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .35; } }

/* The door between the chat and the adventure */
.door { display: flex; justify-content: center; height: 140px; background: linear-gradient(var(--paper) 0 50%, var(--under) 50%); }
.leaf { width: 70px; height: 140px; background: var(--accent); border: 1px solid var(--under); }
.leaf.left { border-radius: 70px 0 0 0; transform-origin: left center; }
.leaf.right { border-radius: 0 70px 0 0; transform-origin: right center; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .leaf { animation: open linear both; animation-timeline: view(); animation-range: entry 20% cover 55%; }
    .leaf.right { animation-name: open-r; }
  }
}
@keyframes open { to { transform: perspective(400px) rotateY(75deg); } }
@keyframes open-r { to { transform: perspective(400px) rotateY(-75deg); } }

/* The Last Prompt, always dark: this is the underlayer */
.underlayer { background: var(--under); color: var(--under-ink); }
.underlayer .kicker, .underlayer .intro { color: var(--under-muted); }
.numbers { list-style: none; padding: 0; margin: 0 0 3rem; display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; color: var(--under-muted); }
.numbers strong { display: block; font: 400 3rem/1 var(--serif); color: var(--under-accent); }
.passage {
  margin: 0; max-width: 40rem; padding: 2rem; border-radius: 28px;
  background: rgba(248, 240, 233, .05); border: 1px solid rgba(248, 240, 233, .12);
}
.passage p { margin: 0 0 1rem; }
.passage .where { font-weight: 600; }
.passage .you { display: table; margin-left: auto; background: #3a2a2d; padding: .4rem 1rem; border-radius: 18px; }
.passage figcaption { font-size: .88rem; color: var(--under-muted); border-top: 1px solid rgba(248, 240, 233, .12); padding-top: 1rem; }

/* Models */
.models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.model { padding: 1.75rem; border-radius: 28px; background: var(--paper-2); border: 1px solid var(--line); }
.tier { width: 56px; height: 56px; color: var(--line); margin-bottom: 1rem; }
.tier .on { color: var(--c); }
.spark { --c: var(--spark); } .flow { --c: var(--flow); } .galaxy { --c: var(--galaxy); }
.model h3 { font: 500 1.5rem/1.15 var(--serif); margin: 0; }
.level { color: var(--c); font-weight: 600; margin: .2rem 0 1.25rem; }
.model dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 0 0 1rem; }
.model dt { font-size: .75rem; color: var(--muted); }
.model dd { margin: 0; font: 500 1.6rem/1.2 var(--serif); }
.adjust { font-size: .9rem; color: var(--muted); margin: 0; }

/* Typed input */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.split p { max-width: 34rem; }
.phrases { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.phrases li { background: var(--bubble); padding: .5rem 1.1rem; border-radius: 20px; }
.phrases li:nth-child(3n+2) { transform: rotate(-1.5deg); }
.phrases li:nth-child(3n) { transform: rotate(1deg); }

/* Screens */
#screens { background: var(--paper-2); }
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.shots img { border-radius: 26px; border: 1px solid var(--line); box-shadow: 0 20px 40px -24px rgba(48, 31, 33, .4); }

/* Privacy trio */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid p { margin: 0; color: var(--muted); }

.contact { text-align: center; padding-top: 0; }
.contact p { font-size: 1.15rem; line-height: 2; }

footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; font-size: .9rem; color: var(--muted); }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.foot p { margin: 0; }
footer nav { display: flex; gap: 1.5rem; }
footer a { color: inherit; }

/* Inner pages: privacy, support, 404 */
.page-head { padding: clamp(3rem, 8vw, 5rem) 0 1rem; }
.page-head .home { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font: 500 1.2rem var(--serif); margin-bottom: 2.5rem; }
.page-head .home svg { width: 30px; height: 30px; color: var(--accent); }
.page-head h1 { font-size: clamp(2.6rem, 7vw, 4rem); }
.prose { max-width: 42rem; padding-top: 1rem; }
.prose h2 { font-size: 1.6rem; margin: 2.5rem 0 .75rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.updated { color: var(--muted); font-size: .92rem; }

@media (max-width: 860px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .chat { justify-self: stretch; max-width: none; }
  .models, .grid { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(2, 1fr); }
}
