:root {
  --bg: #f6f1e7;
  --bg-alt: #efe8d9;
  --ink: #211d18;
  --ink-soft: #55503f;
  --line: rgba(33, 29, 24, 0.12);
  --accent: #c1502e;
  --accent-ink: #f6f1e7;
  --card-bg: #fffdf8;
  --shadow: 0 1px 2px rgba(33, 29, 24, 0.04), 0 8px 24px rgba(33, 29, 24, 0.06);
  --radius: 16px;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1815;
    --bg-alt: #221e19;
    --ink: #f2ece0;
    --ink-soft: #b9b1a0;
    --line: rgba(242, 236, 224, 0.12);
    --accent: #e0714a;
    --accent-ink: #1b1815;
    --card-bg: #24201b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

/* subtle grain texture, no images */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: radial-gradient(circle at 1px 1px, var(--ink) 1px, transparent 0);
  background-size: 3px 3px;
}
@media (prefers-color-scheme: dark) {
  .grain { mix-blend-mode: screen; opacity: 0.05; }
}

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 2px;
  background: var(--bg);
}

.site-nav {
  display: flex;
  gap: 28px;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--ink); }

.nav-toggle,
.nav-close {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  margin: 0;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle svg,
.nav-close svg { width: 24px; height: 24px; display: block; }

.nav-backdrop {
  display: none;
}

/* hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 96px;
}

.hero-inner { position: relative; z-index: 1; max-width: 720px; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.4em;
}

.hero-sub {
  font-size: 1.1rem;
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-shape {
  position: absolute;
  top: -120px;
  right: -160px;
  width: 480px;
  height: 480px;
  border-radius: 40% 60% 55% 45% / 50% 45% 55% 50%;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  z-index: 0;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-small { padding: 10px 18px; font-size: 0.88rem; }

/* sections */
section { padding: 88px 0; }
section h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
}
.section-sub {
  max-width: 56ch;
  margin-bottom: 40px;
  font-size: 1.02rem;
}

.philosophy { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.pillar-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--accent);
  margin-bottom: 16px;
}
.pillar-icon svg { width: 22px; height: 22px; }

.pillar h3 { font-size: 1.15rem; }

/* apps */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.app-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.app-card:hover { transform: translateY(-3px); }

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.app-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.app-icon svg { width: 24px; height: 24px; }

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
}

.app-card h3 { font-size: 1.3rem; }

.feature-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.feature-list li {
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding-left: 20px;
  position: relative;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.app-card .btn { margin-top: auto; align-self: flex-start; }

.app-card-placeholder {
  border-style: dashed;
  box-shadow: none;
  justify-content: center;
  align-items: flex-start;
  opacity: 0.75;
}
.app-card-placeholder:hover { transform: none; }
.app-card-placeholder .app-icon {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--ink-soft);
}

.app-disclaimer {
  padding-top: 30px;
}

/* pwa explainer */
.pwa-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: start;
}

.pwa-facts {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.pwa-facts li {
  font-size: 0.96rem;
  color: var(--ink-soft);
  padding-left: 22px;
  position: relative;
}
.pwa-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.device-support {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.device-support-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.device-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.device-card:last-of-type { border-bottom: none; }

.device-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.device-icon svg { width: 22px; height: 22px; }

.device-card h3 { font-size: 1rem; margin-bottom: 0.2em; }
.device-card p { font-size: 0.9rem; margin: 0; }

.device-support-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .pwa-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* install steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px;
  counter-reset: step;
  padding-bottom: 30px;
}
.steps li {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 600;
}
.steps h3 { font-size: 1.05rem; margin-bottom: 0.25em; }
.steps p { margin: 0; }

/* about */
.about-card {
  background: var(--card-bg); 
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 44px;
}
.about-card > .eyebrow { margin-bottom: 20px; }

.about-copy {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
}

.about-portrait {
  flex: 0 0 200px;
  width: 200px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  padding: 10px;
}
.about-portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: calc(var(--radius) - 8px);
}

.about-text { flex: 1; min-width: 0; }
.about-text p:last-of-type { margin-bottom: 0; }

.about-links {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .about-card { padding: 36px 24px 32px; }
  .about-copy { flex-direction: column; align-items: stretch; gap: 28px; }
  .about-portrait { width: 200px; margin: 0 auto; }
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  section { padding: 64px 0; }
  .hero { padding: 64px 0 72px; }
}

/* mobile nav: hamburger + off-canvas panel */
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }
  .nav-toggle:hover { background: var(--bg-alt); }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 200;
    width: min(300px, 80vw);
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 84px 28px 28px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .site-nav.is-open { transform: translateX(0); }

  .site-nav a {
    font-size: 1.05rem;
    color: var(--ink);
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-close {
    display: inline-flex;
    position: absolute;
    top: 20px;
    right: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }
  .nav-close:hover { background: var(--bg-alt); }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
}

body.nav-open {
  overflow: hidden;
}
