/* Shared styles for every page */

/* ── Fonts, self-hosted so no visitor data goes to Google (licenses in /fonts) ── */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/caveat-500-latin.woff') format('woff');
}

/* ── Colors. Light by default; dark follows the system unless the toggle picked one (data-theme) ── */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #0d0d0d;
  --muted: #8e8e8e;
  --soft: #6b6b6b;
  --line: #ececec;
  --surface: #f4f4f4;
  --surface-2: #e8e8e8;
  --nav-bg: rgba(244, 244, 244, 0.86);
  --nav-fg: #3a3a3a;
  --shadow: rgba(0, 0, 0, 0.08);
  --cta-bg: #0d0d0d;
  --cta-fg: #ffffff;
  --focus: #2f7fd1;
  --badge-bg: #fff3c4;
  --badge-fg: #6b5200;
  --doneago-tile: #e7edf5;
  --doneago-ink: #1f2a3a;
  --doneago-meta: #4f5d70;
  --doneago-line: #3b4757;
  --doneago-cta-bg: #1f2a3a;
  --doneago-cta-fg: #ffffff;
  --nim-tile: #e4f1fc;
  --nim-ink: #0b1630;
  --icon-ring: transparent;
  --footer-bg: #0d0d0d;
  --footer-line: #2a2a2a;

  --gutter: clamp(16px, 4vw, 56px);
  --sans: 'Inter', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --hand: 'Caveat', 'Bradley Hand', cursive;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0e0e;
    --ink: #f2f2f2;
    --muted: #6f6f6f;
    --soft: #9a9a9a;
    --line: #262626;
    --surface: #1a1a1a;
    --surface-2: #2a2a2a;
    --nav-bg: rgba(30, 30, 30, 0.86);
    --nav-fg: #c8c8c8;
    --shadow: rgba(0, 0, 0, 0.4);
    --cta-bg: #f2f2f2;
    --cta-fg: #0d0d0d;
    --focus: #6cb6f0;
    --badge-bg: #3d3200;
    --badge-fg: #ffe08a;
    --doneago-tile: #161d28;
    --doneago-ink: #e7edf5;
    --doneago-meta: #9aa8bb;
    --doneago-line: #c3cdda;
    --doneago-cta-bg: #e7edf5;
    --doneago-cta-fg: #1f2a3a;
    --nim-tile: #0f2238;
    --nim-ink: #e4f1fc;
    --icon-ring: rgba(255, 255, 255, 0.14);
    --footer-bg: #171717;
    --footer-line: #2e2e2e;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0e;
  --ink: #f2f2f2;
  --muted: #6f6f6f;
  --soft: #9a9a9a;
  --line: #262626;
  --surface: #1a1a1a;
  --surface-2: #2a2a2a;
  --nav-bg: rgba(30, 30, 30, 0.86);
  --nav-fg: #c8c8c8;
  --shadow: rgba(0, 0, 0, 0.4);
  --cta-bg: #f2f2f2;
  --cta-fg: #0d0d0d;
  --focus: #6cb6f0;
  --badge-bg: #3d3200;
  --badge-fg: #ffe08a;
  --doneago-tile: #161d28;
  --doneago-ink: #e7edf5;
  --doneago-meta: #9aa8bb;
  --doneago-line: #c3cdda;
  --doneago-cta-bg: #e7edf5;
  --doneago-cta-fg: #1f2a3a;
  --nim-tile: #0f2238;
  --nim-ink: #e4f1fc;
  --icon-ring: rgba(255, 255, 255, 0.14);
  --footer-bg: #171717;
  --footer-line: #2e2e2e;
}

/* ── Base ── */

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.muted { color: var(--muted); }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  font-size: 14px;
  font-weight: 500;
}
.skip-link:focus-visible { top: 16px; }

.label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--soft);
}

/* ── Header ── */

#slot-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 80px;
}

.site-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px var(--gutter);
}

.nav-pill {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: 0 10px 30px var(--shadow);
}

.nav-item {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--nav-fg);
  transition: background 0.2s, color 0.2s;
}
.nav-item svg,
.theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item:hover,
.nav-item.is-active { background: var(--surface-2); color: var(--ink); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px var(--shadow);
  color: var(--nav-fg);
  transition: color 0.2s, transform 0.2s;
}
.theme-toggle:hover { color: var(--ink); transform: rotate(-12deg); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 6px 22px 6px 6px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 10px 30px var(--shadow);
  transition: transform 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-cta-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #0b1630;
}
.nav-cta-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ── Hero ── */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: max(560px, calc(100svh - 80px));
  padding: 44px var(--gutter) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}

.hero-title {
  margin-top: 18px;
  font-size: clamp(36px, 6.2vw, 92px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.hero-title span { display: block; }

/* Buttons sit top left of this row, the octopus bottom right, so it never covers the headline. */
.hero-bottom {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: 32px;
}

.hero-actions {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  position: relative;
  z-index: 2;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn-soft {
  border: 1px solid var(--line);
  background: var(--bg);
}
.btn-soft:hover { background: var(--surface); }
.btn-outline {
  border: 2px solid var(--ink);
  background: var(--bg);
  box-shadow: 0 4px 0 var(--ink), 0 14px 28px var(--shadow);
}
.btn-outline:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink), 0 8px 18px var(--shadow); }
.btn-arrow { font-size: 16px; }

.hero-art {
  position: relative;
  flex: 0 0 auto;
  width: min(26vw, 340px);
  margin-top: 40px;
  margin-bottom: -2px;
}
.hero-art picture { display: block; }
.octopus {
  width: 100%;
  height: auto;
  animation: bob 5s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes bob {
  0%, 100% { transform: translateY(6px); }
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) { .octopus { animation: none; } }

.hero-note {
  position: absolute;
  right: 100%;
  top: -4%;
  font-family: var(--hand);
  font-size: clamp(22px, 1.9vw, 28px);
  white-space: nowrap;
  transform: rotate(-4deg);
  color: var(--ink);
}
.hero-note-arrow {
  position: absolute;
  right: 80%;
  top: 14%;
  width: clamp(56px, 6vw, 80px);
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Sections ── */

.apps,
.about {
  padding: clamp(56px, 7vw, 96px) var(--gutter);
}

.section-head h2 {
  margin-top: 12px;
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* App tiles: a light tint of each app's color, so the icon stands out */
.app-tiles {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 20px;
  margin-top: clamp(28px, 3.5vw, 44px);
}

.app-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-height: clamp(380px, 36vw, 500px);
  padding: clamp(28px, 3vw, 40px);
  border-radius: 32px;
  transition: transform 0.25s, box-shadow 0.25s;
}
a.app-tile:hover { transform: translateY(-4px); box-shadow: 0 24px 50px var(--shadow); }
a.app-tile:focus-visible { outline-offset: 4px; }
.app-tile-doneago { background: var(--doneago-tile); color: var(--doneago-ink); }
.app-tile-nim { background: var(--nim-tile); color: var(--nim-ink); }

.tile-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tile-meta-row { display: flex; align-items: center; gap: 10px; }
.tile-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.app-tile-doneago .tile-meta { color: var(--doneago-meta); }
.tile-name {
  font-size: clamp(40px, 4.4vw, 56px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.tile-line {
  max-width: 300px;
  font-size: 18px;
  line-height: 1.4;
}
.app-tile-doneago .tile-line { color: var(--doneago-line); }
.app-tile-nim .tile-line { max-width: 260px; }

/* DoneAgo's numbers: downloads and store ratings */
.tile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 10px;
}
.tile-stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}
.tile-stat dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--doneago-meta);
}
.tile-stat dd {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.tile-stat svg {
  width: 18px;
  height: 18px;
  fill: #f2b01e;
}

.tile-cta {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
}
.tile-cta svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tile-cta-solid { background: var(--doneago-cta-bg); color: var(--doneago-cta-fg); }
/* Not a link yet: dashed, so it doesn't read as a button */
.tile-cta-soon { border: 2px dashed currentColor; opacity: 0.75; }

.tile-icon {
  position: absolute;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1.2);
}
.app-tile-doneago .tile-icon {
  right: -30px;
  bottom: -40px;
  width: clamp(200px, 25vw, 320px);
  transform: rotate(-10deg);
  box-shadow: 0 0 0 1px var(--icon-ring), 0 30px 60px rgba(0, 0, 0, 0.35);
}
.app-tile-nim .tile-icon {
  right: -50px;
  bottom: -56px;
  width: clamp(170px, 17vw, 250px);
  transform: rotate(8deg);
  box-shadow: 0 30px 60px rgba(11, 22, 48, 0.3);
}
a.app-tile-doneago:hover .tile-icon { transform: rotate(-14deg) scale(1.04); }
a.app-tile-nim:hover .tile-icon { transform: rotate(12deg) scale(1.04); }

.badge {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  white-space: nowrap;
}

.about { border-top: 1px solid var(--line); }
.about-lead {
  margin-top: 16px;
  max-width: 820px;
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

/* ── Legal pages (privacy) ── */

.legal-page { border-top: 1px solid var(--line); }
.legal {
  max-width: calc(720px + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(64px, 8vw, 112px);
  font-size: 16px;
  line-height: 1.65;
}
.legal h1 {
  margin-top: 12px;
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.legal-updated {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--soft);
}
.legal-lead {
  margin-top: 32px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
}
.legal h2 {
  margin-top: 40px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.legal p,
.legal ul { margin-top: 12px; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--muted);
}
.legal a:hover { text-decoration-color: currentColor; }

/* ── 404 ── */

.notfound {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: max(520px, calc(100svh - 80px));
  padding: 44px var(--gutter) 0;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.notfound .hero-title { margin-top: 18px; }
.notfound .hero-actions { margin-top: 32px; }
.notfound .hero-art {
  position: absolute;
  right: var(--gutter);
  bottom: -2px;
  margin: 0;
}

/* ── Footer ── */

.site-footer {
  padding: clamp(56px, 7vw, 96px) var(--gutter) 32px;
  background: var(--footer-bg);
  color: #ffffff;
}
.site-footer .label { color: #8a8a8a; }
.site-footer :focus-visible { outline-color: #6cb6f0; }
.footer-email {
  display: block;
  width: fit-content;
  margin-top: 18px;
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  word-break: break-word;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 6px;
  transition: background-size 0.35s;
}
.footer-email:hover { background-size: 100% 2px; }
.footer-note {
  margin-top: 14px;
  font-size: 15px;
  color: #9a9a9a;
}

.footer-help {
  margin-top: clamp(40px, 5vw, 64px);
}
.footer-help-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin-top: 14px;
}
.footer-help-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.footer-help-list img { border-radius: 7px; }
.footer-help-list .help-app { font-weight: 600; }
.footer-help-list a {
  color: #c8c8c8;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #555555;
}
.footer-help-list a:hover { color: #ffffff; text-decoration-color: currentColor; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: 20px;
  border-top: 1px solid var(--footer-line);
  font-family: var(--mono);
  font-size: 13px;
  color: #8a8a8a;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { border-radius: 8px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a:hover { color: #ffffff; }

/* ── Smaller screens ── */

@media (max-width: 1100px) {
  .hero-note, .hero-note-arrow { display: none; }
}

/* Below laptop width, side by side gets too narrow for the big icons, so the tiles stack at full width */
@media (max-width: 1199px) {
  .app-tiles { grid-template-columns: 1fr; }
  .app-tile { min-height: 400px; }
}

@media (max-width: 760px) {
  #slot-header { min-height: 72px; }
  .site-header { gap: 8px; padding: 12px 16px; }
  .nav-pill { gap: 2px; padding: 5px; }
  .nav-item { width: 40px; height: 40px; }
  .nav-item svg, .theme-toggle svg { width: 18px; height: 18px; }
  .theme-toggle { width: 50px; height: 50px; }
  .nav-cta { height: 50px; padding: 5px; }
  .nav-cta-logo { width: 40px; height: 40px; }
  .nav-cta-text { display: none; }

  .hero, .notfound { min-height: 0; padding-top: 32px; }
  .hero-meta { font-size: 11px; }
  .btn { height: 46px; padding: 0 20px; font-size: 15px; }
  .hero-bottom { flex-direction: column; align-items: stretch; }
  .hero-art {
    align-self: flex-end;
    width: min(70%, 260px);
    margin-top: 40px;
  }
  .notfound .hero-art {
    position: relative;
    right: auto;
    margin: 40px 0 0 auto;
  }

  /* Phones: the icon sits small at the top of the tile instead of covering the text */
  .app-tiles { grid-template-columns: 1fr; }
  .app-tile { min-height: 0; border-radius: 26px; justify-content: flex-start; gap: 24px; }
  .tile-line { max-width: none; font-size: 16px; }
  .app-tile-doneago .tile-icon,
  .app-tile-nim .tile-icon {
    position: static;
    order: -1;
    width: 72px;
    margin: 4px 0 -4px 4px;
    box-shadow: 0 0 0 1px var(--icon-ring), 0 10px 24px rgba(0, 0, 0, 0.22);
  }
  .app-tile-doneago .tile-icon { transform: rotate(-6deg); }
  .app-tile-nim .tile-icon { transform: rotate(6deg); }
  .tile-cta { margin-top: 4px; }
  .hero-art { margin-top: 16px; }
}

@media (max-width: 380px) {
  .nav-item { width: 36px; height: 36px; }
  .theme-toggle, .nav-cta { height: 46px; }
  .theme-toggle { width: 46px; }
  .nav-cta-logo { width: 36px; height: 36px; }
}
