/* Yomita — yomita.ai
 *
 * The supplied layout, recoloured to the brand (docs/brand/README.md).
 *
 * What changed from the draft, and why:
 *   --accent  #2A6DF4 → #DE3B62   Rose is the brand's accent role. A generic
 *                                 tech blue beside an amber-rose-violet mark
 *                                 reads as two companies.
 *   --ink     #0C0E13 → #16101F   Plum rather than near-black, so the page and
 *                                 the app icon's ground share a cast.
 *   greys                         Warmed off blue toward the palette.
 *   placeholders                  Retuned to amber / rose / violet.
 *
 * Untouched: the mark keeps its own gradient, because a logo does not theme.
 */

:root {
  --bg: #ffffff;
  --ink: #16101f;
  --ink-2: #4a4457;
  --muted: #8b8398;
  --line: #ede9f0;
  --wash: #f8f5fa;

  /* Rose. The brand's accent, and the one colour on the page that is not the
     mark or a placeholder. */
  --accent: #de3b62;
  --accent-soft: rgb(222 59 98 / 14%);

  --amber: #f9c463;
  --violet: #6e42a6;

  /* The mark's own gradient, lifted from assets/mark.svg so the wordmark and
     the SVG cannot drift apart. The SVG runs it at 139° across a square; here
     it is shallower, because a wide short word needs the three stops spread
     along its length rather than crammed into its height. */
  --dusk: linear-gradient(115deg, var(--amber) 0%, var(--accent) 50%, var(--violet) 100%);

  --display: "Funnel Display", "Helvetica Neue", Arial, sans-serif;
  --body: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(20px, 4vw, 48px);
  --max: 1200px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-inline: var(--gutter);
}

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* wordmark.js returns early here, so the hero line stays "Yomita". This is
     only in case the class is ever left on by a flip in flight. */
  .flip, .flip.out { transition: none; transform: none; opacity: 1; }
}

/* --- header -------------------------------------------------------------- */

/* The bar stays at the top of the viewport; the header inside it stays the width
 * of the page. Two elements rather than one because the background has to reach
 * both edges of the screen while its contents stay lined up with everything
 * below — so the bar cancels the body gutter with a negative margin and puts it
 * back as padding.
 *
 * A negative margin rather than `width: 100vw`, which counts the scrollbar on
 * platforms that reserve room for one and buys a horizontal scroll with it. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  /* Translucent so the page reads as moving underneath it, opaque enough that
     124px of headline passing behind the nav is still legible. */
  background: rgb(255 255 255 / 86%);
  backdrop-filter: blur(12px);
  /* Always on, rather than appearing once the page scrolls: fading it in needs a
     scroll listener or an IntersectionObserver sentinel, and that is a lot of
     machinery for one hairline. At the top of the page it reads as the divider
     between the bar and the hero, which is what it is. */
  border-bottom: 1px solid var(--line);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 22px;
  max-width: var(--max);
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 25px;
  letter-spacing: -0.015em;
  color: var(--accent);
}

.brand img { display: block; width: 38px; height: 38px; flex: none; }

/* The wordmark carries the mark's gradient, so the name and the pin beside it
   are the same object in two forms. `color` on .brand is the fallback and has
   to stay a real colour: background-clip painting text means transparent glyphs,
   and where the clip does not apply that is an invisible header. */
.wordmark { display: inline-block; }

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .wordmark {
    background-image: var(--dusk);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

@media (max-width: 560px) {
  .brand { font-size: 20px; gap: 10px; }
}

nav { display: flex; gap: 28px; font-size: 14px; }
nav a { text-decoration: none; color: var(--ink-2); }
nav a:hover { color: var(--ink); }

/* --- hero ---------------------------------------------------------------- */

.hero { padding-block: clamp(56px, 10vw, 120px) 0; }

/* The headline and the flipping line share a row, with the flip sitting on the
 * headline's last baseline so it reads as the end of the sentence rather than as
 * a caption parked nearby.
 *
 * `nowrap` and the reserved width below are the whole trick. Left to wrap, the
 * flip drops onto a row of its own as soon as the widest phrase stops fitting —
 * and worse, because every phrase is a different width, whether it wrapped would
 * change every two seconds and take the headline's line breaks with it. The
 * headline gives way instead, and it gives way by the same amount all cycle. */
.hero-head {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(16px, 3vw, 40px);
  align-items: flex-end;
  align-items: last baseline; /* where supported; flex-end is the fallback */
}

.hero-head h1 { flex: 1 1 auto; min-width: 0; }

.flip {
  --flip-out: 180ms;
  flex: 0 0 auto;
  /* Reserved in the flip's OWN em, so the box is the same width at every
     viewport and for every phrase. 8.6em clears the widest of the 24 strings —
     Vietnamese "Bạn · Tôi · Anh ấy" at 7.63em, ahead of Japanese at 7.43em —
     which is what keeps the headline still while the languages change behind it.
     Measure again before adding a language; a phrase wider than this reserve
     puts the headline back to reflowing every two seconds. */
  min-width: 8.6em;
  margin: 0;
  font-family: var(--display), system-ui, "Noto Sans", sans-serif;
  font-weight: 500;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--accent);
  white-space: nowrap;
  text-align: right;
  transform-origin: 50% 60%;
  transition: transform var(--flip-out) ease-in, opacity var(--flip-out) ease-in;
}

.flip.out {
  transform: rotateX(-84deg);
  opacity: 0;
}

/* Stacked, the flip is no longer to the right of anything, so the auto margin
   and the right alignment both have to go or it floats off on its own. */
@media (max-width: 700px) {
  .hero-head { display: block; }
  .flip { min-width: 0; margin: 18px 0 0; text-align: left; }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

h1 {
  font-family: var(--display);
  font-weight: 500;
  /* Capped lower than the 124px it was set alone: the flip now holds a column to
     its right, and at 124px "AI for a better" no longer fits the width that
     leaves, so the headline broke to three lines. This keeps its two. */
  font-size: clamp(44px, 7.2vw, 100px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0;
  max-width: 11ch;
  text-wrap: balance;
}

h1 .soft { color: var(--muted); }

.lede {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--ink-2);
  max-width: 34ch;
  margin: 28px 0 0;
  text-wrap: pretty;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding-inline: 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2336; }
.btn.ghost { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--wash); }

.wave { display: block; width: 100%; height: 72px; margin-top: clamp(40px, 6vw, 72px); }

/* --- image placeholders -------------------------------------------------- */

.ph {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: var(--g, linear-gradient(160deg, #f4ecf6, #fbf3ea));
}

/* A faint grid, so a slot reads as a slot rather than as a finished image and
   nobody ships the page thinking the art is done. */
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(22 16 31 / 3.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(22 16 31 / 3.5%) 1px, transparent 1px);
  background-size: 32px 32px;
}

.ph figcaption {
  position: absolute;
  left: 14px;
  bottom: 12px;
  right: 14px;
  z-index: 1;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgb(22 16 31 / 55%);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ph figcaption b { font-weight: 500; color: rgb(22 16 31 / 80%); }

figure { margin: 0; }

/* A filled slot is a photograph, not a slot: the gradient underneath and the
   grid over the top both go. Explicit class rather than `:has(img)` so the
   result does not depend on selector support — a faint grid ruled across a
   photo reads as a rendering fault, not as a style. */
.ph.filled { background: var(--wash); }
.ph.filled::after { display: none; }

.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dusk, opened out across the frame: amber low-left through rose to violet. */
.hero .ph {
  aspect-ratio: 16 / 7;
  --g: radial-gradient(120% 90% at 50% 110%, #fce9d2 0%, #f6e6ef 40%, #e6ddf5 75%, #f5f1fb 100%);
}

/* --- sections ------------------------------------------------------------ */

section { padding-block: clamp(88px, 12vw, 148px) 0; }

.head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 48px;
}

@media (min-width: 900px) {
  .head { grid-template-columns: 1fr 1fr; align-items: end; }
}

h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 14px 0 0;
  text-wrap: balance;
  max-width: 14ch;
}

.head p {
  color: var(--ink-2);
  font-size: 18px;
  max-width: 38ch;
  margin: 0;
  text-wrap: pretty;
}

/* --- products ------------------------------------------------------------ */

.products { display: grid; gap: 40px 24px; grid-template-columns: 1fr; }

@media (min-width: 600px)  { .products { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .products { grid-template-columns: repeat(4, 1fr); } }

.product .ph { aspect-ratio: 4 / 5; }

.product h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 20px 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 30ch; }

.chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chip.first { color: var(--accent); }

.chip.first::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.specs {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  letter-spacing: 0.02em;
}

.product.more .ph {
  --g: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid;
  place-items: center;
}

.product.more .ph::after { display: none; }

.more-mark {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 400;
  color: var(--line);
  line-height: 1;
}

/* --- principles ---------------------------------------------------------- */

.ph.wide {
  aspect-ratio: 21 / 9;
  --g: linear-gradient(180deg, #e7ddf4 0%, #f4eff8 55%, #fbf2e8 100%);
}

.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 32px;
  margin-top: 56px;
}

@media (min-width: 800px) { .principles { grid-template-columns: repeat(3, 1fr); } }

.principle { border-top: 1px solid var(--line); padding-block: 24px 8px; }

.principle h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.principle p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 32ch; }

/* --- closing + footer ---------------------------------------------------- */

.close { padding-block: clamp(96px, 12vw, 160px) clamp(72px, 9vw, 120px); }
.close h2 { max-width: 16ch; }
.close .actions { margin-top: 28px; }

footer {
  border-top: 1px solid var(--line);
  padding-block: 24px 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  max-width: var(--max);
  margin-inline: auto;
}

footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

@media (max-width: 520px) { nav a.hide-sm { display: none; } }
