/* DEVi8.design
   One stylesheet, no build step. Colors are tokens on :root, written once with light-dark(),
   so a theme is just a color-scheme. Naming: .row is a full-width page band, .column is a
   side-by-side child, matching the Figma container names. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --bg: light-dark(#FBFBFA, #0D0E11);
  --bg-raised: light-dark(#FFFFFF, #15171B);
  --ink: light-dark(#15161A, #EEEEF0);
  --ink-2: light-dark(#55585F, #A5A9B2);
  --ink-3: light-dark(#6B6E75, #8B8F98);
  --line: light-dark(#E7E6E2, #23262C);
  --line-strong: light-dark(#D3D1CB, #353840);
  /* Brand blue. #0081E1 is 3.9 to 1 on the light page: right for dots, lines, focus rings and
     large type (3 to 1 needed), not small text. --accent-strong is the same blue a step deeper
     for small text and for button fills with white text (4.8 to 1). Dark mode uses a brighter
     blue of the same hue (7.5 to 1), with dark text on its fills. */
  --accent: light-dark(#0081E1, #4DA8F2);
  --accent-strong: light-dark(#0072C7, #4DA8F2);
  --on-accent: light-dark(#FFFFFF, #0D0E11);
  --accent-wash: light-dark(rgb(0 129 225 / 0.08), rgb(77 168 242 / 0.12));
  --header-bg: light-dark(rgb(251 251 250 / 0.78), rgb(13 14 17 / 0.72));
  --shadow-color: light-dark(rgb(21 22 26 / 0.12), rgb(0 0 0 / 0.5));

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(80px, 11vw, 150px);
  --radius: 14px;
  --radius-lg: clamp(22px, 3vw, 32px);
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Images that only belong to one theme. Lazy images that are hidden never download. */
.theme-dark-only { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark-only { display: block !important; }
  :root:not([data-theme="light"]) .theme-light-only { display: none !important; }
}
:root[data-theme="dark"] .theme-dark-only { display: block !important; }
:root[data-theme="dark"] .theme-light-only { display: none !important; }

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, p, ul, ol, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--accent-strong); color: var(--on-accent); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.eyebrow__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

h1, h2, h3 {
  font-weight: 700;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 1.25rem + 3vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-head h2 { margin-top: 14px; }

.section-head__lede {
  margin-top: 18px;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  text-wrap: pretty;
}

/* ---------- Buttons and links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.button:active { transform: scale(0.98); }

.button--primary { background: var(--ink); color: var(--bg); }
.button--primary:hover { background: var(--accent-strong); color: var(--on-accent); }

.button--ghost { border-color: var(--line-strong); color: var(--ink); background: var(--bg); }
.button--ghost:hover { border-color: var(--ink); }

.button__arrow {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}
.button:hover .button__arrow { transform: translate(2px, -2px); }

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.text-link:hover { text-decoration-thickness: 2px; }

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  border-radius: 8px;
}

.brand__word {
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand__tld {
  margin-left: 1px;
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.82em;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.site-nav a:hover { color: var(--ink); background: var(--accent-wash); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.25s, transform 0.4s var(--ease);
}
.theme-toggle__sun { opacity: 0; transform: rotate(-45deg) scale(0.6); }
.theme-toggle[aria-pressed="true"] .theme-toggle__moon { opacity: 0; transform: rotate(45deg) scale(0.6); }
.theme-toggle[aria-pressed="true"] .theme-toggle__sun { opacity: 1; transform: none; }

@media (max-width: 559px) {
  .site-nav { display: none; }
  .theme-toggle { margin-left: auto; }
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  align-items: center;
  min-height: min(calc(100svh - var(--header-h)), 820px);
  padding-block: clamp(48px, 8vw, 104px);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.hero__title {
  margin-top: 22px;
  font-size: clamp(2.75rem, 1.2rem + 4.6vw, 5.25rem);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero__lede {
  max-width: 34rem;
  margin-top: 26px;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

/* The shelf: the apps as a Home Screen, with a spot kept for the next one. Its wallpaper
   blends the three apps' own colors. */
.shelf {
  --icon: clamp(76px, 9vw, 112px);
  justify-self: end;
  width: min(100%, 480px);
  padding: clamp(28px, 4vw, 48px) clamp(20px, 3.5vw, 44px) clamp(18px, 2.5vw, 26px);
  border: 1px solid var(--line);
  border-radius: clamp(32px, 4vw, 48px);
  background:
    radial-gradient(60% 60% at 15% 20%, light-dark(#DCE3EE, #2A3242), transparent 70%),
    radial-gradient(60% 60% at 90% 25%, light-dark(#F3E6D2, #182A44), transparent 70%),
    radial-gradient(70% 70% at 50% 100%, light-dark(#DCEBEC, #13303A), transparent 70%),
    var(--bg-raised);
  box-shadow: 0 30px 70px -40px var(--shadow-color);
}

.shelf__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 32px) clamp(8px, 2vw, 24px);
}

.shelf__app,
.shelf__next {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  padding: 8px 4px;
  border-radius: 20px;
  text-align: center;
  text-decoration: none;
}

.shelf__tile {
  display: grid;
  place-items: center;
  width: var(--icon);
  height: var(--icon);
}

/* The iPhone icons carry their own corner shape and shadow; the Chrome icon is a flat square,
   so it gets the same corner and a matching shadow. */
.shelf__icon {
  width: 100%;
  height: 100%;
  transition: transform 0.35s var(--ease);
  filter: drop-shadow(0 10px 16px rgb(0 0 0 / 0.16));
}
.shelf__icon--flat {
  width: 87.5%;
  height: 87.5%;
  border-radius: 23%;
}
.shelf__app:hover .shelf__icon,
.shelf__app:focus-visible .shelf__icon { transform: translateY(-4px) scale(1.04); }

.shelf__name {
  display: grid;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.25;
  text-wrap: balance;
}
.shelf__meta {
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-weight: 400;
}
.shelf__next .shelf__name { color: var(--ink-3); }

.shelf__slot {
  width: 87.5%;
  height: 87.5%;
  overflow: visible;
  color: var(--ink-3);
}
.shelf__slot rect {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
  stroke-dasharray: 6 6;
  vector-effect: non-scaling-stroke;
}
.shelf__slot path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* Page dots, like a Home Screen with more pages to come. */
.shelf__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(14px, 2vw, 22px);
}
.shelf__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}
.shelf__dots i:first-child { background: var(--ink-2); }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .shelf { justify-self: start; }
}

@media (max-width: 479px) {
  .shelf { --icon: 72px; }
  .shelf__name { font-size: 0.875rem; }
  .shelf__meta { font-size: 0.75rem; }
}

/* ---------- Apps ---------- */

.apps { padding-block: clamp(48px, 7vw, 96px) 0; }

/* Each card sets its own palette. Values come from each app's own site and pass WCAG AA. */
.app {
  --app-bg: #E5E9F0;
  --app-ink: #2E3440;
  --app-ink-2: #4C566A;
  --app-accent: #47689A;
  --app-on-accent: #FFFFFF;
  --app-line: rgb(46 52 64 / 0.1);
  --app-glow: rgb(94 129 172 / 0.22);

  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--app-line);
  border-radius: var(--radius-lg);
  background: var(--app-bg);
  color: var(--app-ink);
  overflow: clip;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.app + .app { margin-top: clamp(20px, 3vw, 32px); }

.app--persistcss {
  --app-bg: light-dark(#E5E9F0, #2E3440);
  --app-ink: light-dark(#2E3440, #ECEFF4);
  --app-ink-2: light-dark(#4C566A, #C5CDD9);
  --app-accent: light-dark(#47689A, #88C0D0);
  --app-on-accent: light-dark(#FFFFFF, #2E3440);
  --app-line: light-dark(rgb(46 52 64 / 0.1), rgb(236 239 244 / 0.1));
  --app-glow: light-dark(rgb(94 129 172 / 0.28), rgb(136 192 208 / 0.18));
}

.app--unseen {
  --app-bg: light-dark(#F3ECE0, #112339);
  --app-ink: light-dark(#2A1F14, #EEF3FA);
  --app-ink-2: light-dark(#554536, #AEBFD6);
  --app-accent: light-dark(#36629B, #93BDF4);
  --app-on-accent: light-dark(#FFFFFF, #0D1422);
  --app-line: light-dark(rgb(42 31 20 / 0.09), rgb(238 243 250 / 0.1));
  --app-glow: light-dark(rgb(255 214 150 / 0.55), rgb(147 189 244 / 0.16));
}

.app--kisetsu {
  --app-bg: light-dark(#E8F0F1, #10212B);
  --app-ink: light-dark(#253E46, #F3F6F5);
  --app-ink-2: light-dark(#4E636A, #B3C3C7);
  --app-accent: light-dark(#486D78, #AFD4DF);
  --app-on-accent: light-dark(#FFFFFF, #10212B);
  --app-line: light-dark(rgb(37 62 70 / 0.1), rgb(243 246 245 / 0.1));
  --app-glow: light-dark(rgb(175 212 223 / 0.6), rgb(175 212 223 / 0.14));
}

.app--flip .app__copy { order: 2; }

/* The browser needs more room than a phone to show anything. */
.app--persistcss { grid-template-columns: minmax(0, 4.5fr) minmax(0, 6.5fr); }

.app__id {
  display: flex;
  align-items: center;
  gap: 18px;
}

.app__icon {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 17px;
  box-shadow: 0 8px 20px -10px rgb(0 0 0 / 0.35);
}

/* These icons are drawn with their own corner shape and shadow. */
.app__icon--shaped {
  width: 80px;
  height: 80px;
  margin: -4px;
  border-radius: 0;
  box-shadow: none;
}

.app__kind {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--app-ink-2);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.app__num {
  padding: 1px 7px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 0.75rem;
}

.app__name {
  margin-top: 4px;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.app__status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.app__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-bg) 60%, light-dark(#FFFFFF, #000000));
  color: var(--app-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.app__badge--live::before,
.app__badge--beta::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--app-accent);
}
.app__badge--live::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-accent) 25%, transparent); }

.app__tagline {
  margin-top: 26px;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.app__lede {
  margin-top: 12px;
  color: var(--app-ink-2);
  text-wrap: pretty;
}

.app__points {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.app__points li {
  position: relative;
  padding-left: 28px;
  font-size: 0.96875rem;
  line-height: 1.45;
}

/* A small deviating tick, the brand line at list size. */
.app__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 18px;
  height: 18px;
  background: var(--app-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M2 12h4c2 0 2-6 4.5-6H16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M2 12h4c2 0 2-6 4.5-6H16' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.app__aside {
  margin-top: 20px;
  color: var(--app-ink-2);
  font-size: 0.9375rem;
}

.app__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 32px;
}

.button--app { background: var(--app-accent); color: var(--app-on-accent); }
.button--app:hover { background: var(--app-ink); color: var(--app-bg); }

.app .text-link { color: var(--app-ink); }
.app :focus-visible { outline-color: var(--app-accent); }

/* Media column */

.app__media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
}

.app__media::before {
  content: "";
  position: absolute;
  inset: -20% -30%;
  z-index: 0;
  background: radial-gradient(closest-side, var(--app-glow), transparent);
  pointer-events: none;
}

.app__media > :not(.float-card) { position: relative; z-index: 1; }

/* Browser window for the Chrome extension */

.browser {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgb(0 0 0 / 0.12);
  border-radius: var(--radius);
  background: #1A1F2A;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.08),
    0 24px 60px -24px rgb(20 24 34 / 0.55);
}

.browser__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 34px;
  padding: 0 12px;
  background: #242A36;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}

.browser__dots { display: flex; gap: 6px; }
.browser__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4C566A;
}

.browser__url {
  flex: 1;
  max-width: 260px;
  margin-inline: auto;
  padding: 3px 12px;
  border-radius: 999px;
  background: #1A1F2A;
  color: #A9B4C6;
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser__shot { width: 100%; }

/* Phone */

.app__media--phone { padding-block: 8px; }

.phone {
  --phone-w: clamp(210px, 22vw, 280px);
  position: relative;
  width: var(--phone-w);
  padding: calc(var(--phone-w) * 0.032);
  border-radius: calc(var(--phone-w) * 0.165);
  background: #0B0C0E;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.12),
    0 2px 4px rgb(0 0 0 / 0.1),
    0 30px 60px -26px rgb(0 0 0 / 0.55);
}

/* The Dynamic Island, drawn over the screenshot's status bar like on a real phone. */
.phone::after {
  content: "";
  position: absolute;
  top: calc(var(--phone-w) * 0.058);
  left: 50%;
  width: 29%;
  height: calc(var(--phone-w) * 0.085);
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

.phone__screen {
  width: 100%;
  border-radius: calc(var(--phone-w) * 0.135);
}

/* Floating cards */

.float-card {
  position: absolute;
  z-index: 2;
}

.float-card--code {
  left: clamp(-8px, -1vw, 0px);
  bottom: clamp(-32px, -3vw, -12px);
  width: min(300px, 74%);
  padding: 14px 16px 12px;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 12px;
  background: #2E3440;
  color: #D8DEE9;
  box-shadow: 0 20px 40px -18px rgb(0 0 0 / 0.6);
}

.code-card__file {
  color: #A9B4C6;
  font-family: var(--mono);
  font-size: 0.6875rem;
}

.code-card__code {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
  overflow: hidden;
}

.t-sel { color: #8FBCBB; }
.t-prop { color: #88C0D0; }
.t-fn { color: #81A1C1; }
.t-var { color: #EBCB8B; }

.code-card__note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgb(255 255 255 / 0.08);
  color: #A3BE8C;
  font-size: 0.75rem;
  font-weight: 600;
}
.code-card__note svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.float-card--image {
  width: clamp(220px, 24vw, 300px);
  filter: drop-shadow(0 18px 30px rgb(0 0 0 / 0.22));
}
.float-card--image img { width: 100%; }

.float-card--unseen { left: 0; bottom: 10%; }

/* Phones sit off-center so their floating card overlaps the edge, not the content. */
.app--unseen .phone { justify-self: end; margin-right: 6%; }
.app--kisetsu .phone { justify-self: start; margin-left: 6%; }

.float-card--levels {
  right: 0;
  top: 46%;
  display: grid;
  gap: 8px;
  width: clamp(220px, 22vw, 270px);
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: light-dark(#FFFFFF, #203641);
  color: var(--app-ink);
  box-shadow: 0 20px 40px -20px rgb(16 33 43 / 0.45);
}

.float-card--levels li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 4px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}
.float-card--levels img { width: 26px; height: 26px; flex: none; }

.level {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.level--high { background: light-dark(#F8E5DD, #593D34); color: light-dark(#883B28, #FFCFBA); }
.level--mod { background: light-dark(#F7EBCF, #51462D); color: light-dark(#77500F, #FBE0A4); }
.level--low { background: light-dark(#E4EEE5, #304C43); color: light-dark(#315844, #D1E7D5); }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app--flip .app__copy { order: 0; }
  .app__media { margin-top: 8px; }
  .app--persistcss .app__media { padding-bottom: 28px; }
  .float-card--code { left: -6px; bottom: -6px; }
  .app--unseen .phone,
  .app--kisetsu .phone { justify-self: center; margin-inline: 0; }
  .float-card--unseen { left: -4px; bottom: 6%; }
  .float-card--levels { right: -4px; top: 48%; }
}

@media (max-width: 479px) {
  .app__icon { width: 60px; height: 60px; border-radius: 14px; }
  .app__icon--shaped { width: 68px; height: 68px; }
  .float-card--image { width: 62%; }
  .float-card--levels { width: max-content; max-width: 86%; padding: 8px; gap: 4px; }
  .float-card--levels li { padding: 4px 2px; font-size: 0.75rem; gap: 8px; white-space: nowrap; }
  .float-card--levels img { width: 20px; height: 20px; }
  .level { margin-left: 12px; padding: 2px 8px; font-size: 0.6875rem; }
  .float-card--code { width: 88%; padding: 12px 14px 10px; }
  .code-card__code { font-size: 0.6875rem; }
}

/* ---------- Approach ---------- */

.approach { padding-block: var(--section); }

.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  counter-reset: principle;
}

.principle {
  padding: clamp(24px, 3.5vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
}

.principle__default {
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.principle__label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.principle__default s {
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-3);
}

.deviation {
  width: 100%;
  height: 28px;
  margin: 22px 0 18px;
  overflow: visible;
}

.deviation path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.deviation__default { stroke: var(--line-strong); stroke-dasharray: 2 6; }
.deviation__path { stroke: var(--accent); }

.principle__title {
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.principle p:last-child {
  margin-top: 10px;
  color: var(--ink-2);
  text-wrap: pretty;
}

@media (max-width: 719px) {
  .principles { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- About ---------- */

.about {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}

.about__inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}

.about__story h2 { margin-top: 14px; margin-bottom: 26px; }
.about__story p:not(.eyebrow) {
  max-width: 36rem;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  text-wrap: pretty;
}
.about__story p + p { margin-top: 14px; }

.contact__title {
  margin-bottom: 14px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
}

.contact-list { border-top: 1px solid var(--line); }
.contact-list li { border-bottom: 1px solid var(--line); }

.contact-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  padding: 18px 4px;
  text-decoration: none;
  border-radius: 8px;
}

.contact-link__label { font-weight: 650; }
.contact-link__url {
  grid-row: 2;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.contact-link__arrow {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease), color 0.2s;
}
.contact-link:hover .contact-link__label { color: var(--accent-strong); }
.contact-link:hover .contact-link__arrow { color: var(--accent); transform: translate(3px, -3px); }

@media (max-width: 859px) {
  .about__inner { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Definition ----------
   The name, explained as a dictionary entry, as the page's sign-off. */

.define {
  padding-block: var(--section) clamp(64px, 8vw, 112px);
  border-top: 1px solid var(--line);
  overflow: clip;
}

.define__word {
  font-size: clamp(4.25rem, 0.6rem + 17vw, 16rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.06em;
  white-space: nowrap;
}
/* Matches the header logo: the name in ink, ".design" in blue. */
.define__tld {
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 0.22em;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.define__entry {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 80px);
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--line-strong);
}

.define__head { display: grid; gap: 6px; align-content: start; }
.define__hw {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.define__pron { color: var(--ink-2); font-family: var(--mono); font-size: 0.9375rem; }
.define__pos {
  color: var(--accent-strong);
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  font-size: 1.0625rem;
  font-style: italic;
}

.define__senses { display: grid; gap: 16px; counter-reset: sense; }
.define__senses li {
  position: relative;
  padding-left: 40px;
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  font-size: clamp(1.1875rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.4;
  text-wrap: pretty;
}
.define__senses li::before {
  counter-increment: sense;
  content: counter(sense);
  position: absolute;
  left: 0;
  top: 0.2em;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.define__example {
  margin-top: 14px;
  padding-left: 40px;
  color: var(--ink-2);
  font-family: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  font-size: 1.0625rem;
  font-style: italic;
}

/* The column is a container, so "See also" can stack by the room it actually has. */
.define__body { container-type: inline-size; }

.define__see {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 30px;
  padding-left: 40px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.define__see-label { font-family: ui-serif, "New York", Georgia, serif; font-style: italic; }
.define__see a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}
.define__see a:hover { text-decoration: underline; text-underline-offset: 4px; }
.define__see img { width: 28px; height: 28px; border-radius: 7px; }
.define__see img.define__shaped { width: 32px; height: 32px; margin: -2px; border-radius: 0; }

/* One line needs about 575px with Apple's system font, a little more with others. Below 620px
   the links stack under "See also" instead of wrapping partway. */
@container (max-width: 619px) {
  .define__see { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 859px) {
  .define__entry { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 479px) {
  .define__senses li,
  .define__example,
  .define__see { padding-left: 36px; }
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 40px;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer__brand { display: grid; gap: 10px; }
.site-footer__fine { max-width: 40rem; }

.site-footer__fine {
  color: var(--ink-3);
  font-size: 0.875rem;
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.site-footer__nav a {
  color: var(--ink-2);
  font-size: 0.9375rem;
  text-decoration: none;
}
.site-footer__nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 404 ---------- */

.lost {
  display: grid;
  align-content: center;
  min-height: calc(100svh - var(--header-h) - 120px);
  padding-block: var(--section);
}

.lost h1 {
  margin-top: 18px;
  font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.lost p:not(.eyebrow) {
  max-width: 30rem;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 1.1875rem;
}

.lost .button { justify-self: start; margin-top: 30px; }

.lost .deviation { max-width: 360px; margin-top: 32px; }

/* ---------- Motion ---------- */

/* Sections rise in as they arrive. The hero never fades, so the first paint is the real one. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--ease), transform 0.9s var(--ease);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }

  .js .principle .deviation__path {
    clip-path: inset(-4px 100% -4px -4px);
    transition: clip-path 1.2s var(--ease) 0.25s;
  }
  .js .principle.is-in .deviation__path { clip-path: inset(-4px -4px -4px -4px); }

  /* The shelf's icons settle in one after another, like a Home Screen opening. */
  .js .shelf__tile {
    animation: shelf-in 0.7s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 90ms + 120ms);
  }

  /* The empty spot's outline moves while the pointer is over the shelf. */
  .shelf:hover .shelf__slot rect { animation: shelf-march 0.9s linear infinite; }
}

@keyframes shelf-in {
  from { opacity: 0; transform: translateY(10px) scale(0.86); }
}

@keyframes shelf-march {
  to { stroke-dashoffset: -12; }
}

/* ---------- Print ---------- */

@media print {
  .site-header,
  .theme-toggle,
  .shelf__dots { display: none; }
  .app { break-inside: avoid; }
}
