@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-var.woff2') format('woff2');
}

/* One system, two skins. Brand = tokens, never duplicated rules. */
:root {
  --paper: #FFFFFF;
  --ink: #0B0F0D;
  --muted: #5A615D;
  --rule: rgba(11, 15, 13, 0.16);
  --rule-strong: #0B0F0D;
  --tint: #F4F5F2;

  --velvet: #0F4A3A;
  --night: #0A2E25;
  --emerald: #1B6B52;
  --mist: #E3ECE7;
  --brass: #B89B5E;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --radius-tile: 12px;
  --radius-card: 0;
  --wrap: 1120px;
  --pad: 22px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-brand="nr"]) {
    --paper: #0B0F0D;
    --ink: #F5F6F3;
    --muted: #9AA39D;
    --rule: rgba(245, 246, 243, 0.16);
    --rule-strong: #F5F6F3;
    --tint: #141917;
    color-scheme: dark;
  }
  /* monochrome app marks need a light accent to stay legible on black */
  :root:not([data-brand="nr"]) [data-app="ankaid"],
  :root:not([data-brand="nr"]) [data-app="roadmaps"] { --accent: #F5F6F3; }
  :root:not([data-brand="nr"]) .strip img { border-color: rgba(245, 246, 243, 0.3); }
}

/* Next Rotation keeps its light velvet/brass identity (deliberate, no dark variant). */
[data-brand="nr"] {
  --paper: #F7F8F5;
  --ink: #0B0F0D;
  --muted: #4A5A52;
  --rule: rgba(11, 15, 13, 0.16);
  --rule-strong: #0F4A3A;
  --tint: #E3ECE7;
  --radius-card: 10px;
  --wrap: 1080px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: inherit; }

img { max-width: 100%; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
  margin: 0;
}

:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
  width: 100%;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  border: 2px solid var(--rule-strong);
  z-index: 5;
}
.skip:focus { left: 12px; top: 12px; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.mark { width: 28px; height: 28px; border-radius: 6px; display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-brand="nr"]) .mark { filter: invert(1); }
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 26px);
  font-size: 0.875rem;
}
.nav a {
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--rule-strong); }
.nav a[aria-current="page"] { border-bottom-color: var(--rule-strong); }

/* Homepage */
.hero { padding: clamp(52px, 9vw, 104px) 0 clamp(36px, 5vw, 56px); }
.hero h1 {
  font-size: clamp(2.6rem, 8.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 16ch;
}
.subline {
  margin: 20px 0 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
}

.strip {
  margin-top: clamp(36px, 6vw, 64px);
  border-top: 1px solid var(--rule);
  padding-top: 24px;
}
.strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 22px 8px;
}
.strip a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
}
.strip img {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-tile);
  border: 1px solid var(--rule);
  transition: transform 140ms ease;
}
.strip a:hover img { transform: translateY(-2px); }
.strip a:hover span { text-decoration: underline; text-underline-offset: 3px; }

.blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 44px);
  margin-top: clamp(48px, 8vw, 88px);
}
@media (min-width: 760px) {
  .blocks { grid-template-columns: 1fr 1fr; gap: 56px; }
}
.block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 2px solid var(--rule-strong);
  text-decoration: none;
  min-height: 148px;
}
.block h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.125rem);
  letter-spacing: -0.03em;
}
.block p { margin: 0; color: var(--muted); max-width: 32ch; }
.block .go {
  margin-top: auto;
  padding-top: 20px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.block .go .arrow { display: inline-block; transition: transform 140ms ease; }
.block:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.block:hover .go .arrow { transform: translateX(4px); }

.contact { margin: clamp(44px, 7vw, 72px) 0 0; }
.contact a {
  font-family: var(--display);
  font-size: clamp(1.0625rem, 2vw, 1.375rem);
  font-weight: 500;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(48px, 7vw, 80px);
  padding: 18px 0 30px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.site-footer p { margin: 0 0 6px; }
.site-footer a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Page headers, back links */
.page-head { padding-top: clamp(28px, 5vw, 48px); }
.back {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
}
.back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.page-title { font-size: clamp(2.4rem, 6vw, 4rem); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 2px solid var(--rule-strong);
  background: var(--rule-strong);
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-card);
  transition: background-color 140ms ease, color 140ms ease;
}
.btn:hover, .btn:focus-visible { background: transparent; color: var(--ink); }

/* App cards */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 clamp(28px, 4vw, 56px);
  margin: clamp(28px, 4vw, 44px) 0 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 800px) { .app-grid { grid-template-columns: 1fr 1fr; } }

.app {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}
.app-head { display: flex; align-items: center; gap: 14px; }
.app-head h2 { font-size: 1.375rem; letter-spacing: -0.02em; }
/* Icon sits on a tinted tile so each app carries its own colour without inventing art. */
.app-icon {
  width: 72px;
  height: 72px;
  padding: 8px;
  flex: 0 0 auto;
  border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--accent, var(--rule-strong)) 28%, var(--rule));
  background: color-mix(in oklab, var(--accent, var(--rule-strong)) 9%, var(--paper));
  transition: transform 140ms ease;
}
.app:hover .app-icon { transform: translateY(-2px); }
[data-app="dumpit"] { --accent: #E8B50C; }
[data-app="pomodoshi"] { --accent: #FF6B5A; }
[data-app="redoshi"] { --accent: #FF3D7F; }
[data-app="ankaid"] { --accent: #0B0F0D; }
[data-app="roadmaps"] { --accent: #0B0F0D; }

.app p { margin: 0; color: var(--muted); max-width: 44ch; }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
}
.chips li {
  font-size: 0.75rem;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--muted);
}

.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 4px; }
.link-action {
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.link-action:hover { text-decoration-thickness: 2px; }

/* Detail pages */
.detail { max-width: 820px; padding-bottom: 8px; }
.detail-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.detail-head .app-icon { width: 64px; height: 64px; }
.detail-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.lede { margin: 0 0 18px; font-size: clamp(1.0625rem, 1.8vw, 1.25rem); max-width: 58ch; }
.lede + .chips { margin-bottom: 26px; }
.detail h2 { font-size: clamp(1.375rem, 2.6vw, 1.75rem); margin: 44px 0 12px; }
.detail p { max-width: 66ch; }

.hash {
  margin: 20px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--tint);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---- Next Rotation skin ---- */
[data-brand="nr"] .hero {
  background: var(--velvet);
  color: #FFFFFF;
  padding: clamp(34px, 5.5vw, 68px) 0;
}
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; }
.hero-head { display: flex; align-items: center; gap: clamp(14px, 2vw, 22px); min-width: 0; }
.logo-slot {
  width: clamp(76px, 8vw, 96px);
  height: clamp(76px, 8vw, 96px);
  padding: 5px;
  border-radius: 22px;
  background: var(--night);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-slot img { width: 100%; height: 100%; object-fit: contain; border-radius: 18px; }
.hero-head h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); color: #FFFFFF; min-width: 0; }
.hero-body { min-width: 0; }
.tagline {
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
  max-width: 36ch;
  margin: 0 0 26px;
  color: #EAF1ED;
}
.btn-brand {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: var(--velvet);
}
.btn-brand:hover, .btn-brand:focus-visible { background: #FFFFFF; color: var(--night); border-color: var(--brass); }
.rule { width: 64px; height: 3px; background: var(--brass); border: 0; margin: 26px 0 0; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 5vw, 72px); }
}

[data-brand="nr"] section { padding: clamp(40px, 7vw, 76px) 0; }
[data-brand="nr"] section h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 clamp(20px, 3vw, 30px); }
.split { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 900px) {
  .split { grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }
  .split > h2 { margin: 0; }
}
.statement {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 30ch;
}
.band { background: var(--mist); }
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--brass);
  border-radius: var(--radius-card);
  padding: 22px;
}
.card h3 { font-size: 1.1875rem; letter-spacing: -0.02em; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 0.9375rem; }
.soon {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--velvet);
  background: var(--mist);
  border-radius: 4px;
  padding: 5px 8px;
}
[data-brand="nr"] .updates p { margin: 0 0 10px; }
[data-brand="nr"] .updates a { color: var(--emerald); font-weight: 600; text-underline-offset: 3px; }
[data-brand="nr"] .site-footer {
  background: var(--night);
  color: #E6EFEA;
  border-top: 0;
  margin-top: 0;
  padding: 32px 0 40px;
  font-size: 0.875rem;
}
[data-brand="nr"] .site-footer p { max-width: 70ch; }
[data-brand="nr"] .site-footer a { color: #FFFFFF; }
[data-brand="nr"] .site-footer .top { display: inline-block; margin-top: 10px; }

/* Short landscape phones: keep hero and rhythm above the fold */
@media (orientation: landscape) and (max-height: 520px) {
  .hero { padding: 24px 0 32px; }
  .hero h1 { font-size: clamp(1.9rem, 4.2vw, 2.6rem); }
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 28px; }
  [data-brand="nr"] .hero { padding: 24px 0; }
  .logo-slot { width: 56px; height: 56px; border-radius: 14px; }
  .rule { display: none; }
  [data-brand="nr"] section { padding: 32px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .strip a:hover img, .app:hover .app-icon { transform: none; }
}
