/* Prefolio landing - "Warm Notebook" design system
   Tokens mirror the mobile app's lib/theme.ts exactly. */

:root {
  --bg: #f5efe2;
  --surface: #fbf6ea;
  --surface-alt: #f0e9d9;
  --border: rgba(38, 28, 18, 0.10);
  --border-strong: rgba(38, 28, 18, 0.18);
  --divider: rgba(38, 28, 18, 0.08);
  --text: #1f1812;
  --text-sec: #6b5b46;
  --text-ter: #998871;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --accent-deep: #115e59;
  --accent-ink: #134e4a;
  --card-radius: 16px;
  --btn-radius: 999px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --body: Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Paper grain over everything, very faint */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: var(--accent-deep); }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- type helpers ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-ter);
}

.section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* ---------- nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 22px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.wordmark img { width: 30px; height: auto; }

.wordmark span {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.nav-right { display: flex; align-items: center; gap: 22px; }

.nav-link {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-sec);
  text-decoration: none;
}

.nav-link:hover { color: var(--accent-deep); }

.soon-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid rgba(17, 94, 89, 0.25);
  border-radius: var(--btn-radius);
  padding: 5px 12px;
  white-space: nowrap;
}

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

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 64px 0 96px;
  position: relative;
}

/* ruled notebook lines behind the hero copy */
.hero::before {
  content: "";
  position: absolute;
  inset: 24px 55% 48px -40px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 35px,
    var(--divider) 35px,
    var(--divider) 36px
  );
  z-index: -1;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(42px, 6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 18px 0 22px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-deep);
}

.hero .lede {
  font-size: 18px;
  color: var(--text-sec);
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-ctas { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.cta-primary {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--accent);
  border-radius: var(--btn-radius);
  padding: 13px 26px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cta-primary:hover { background: var(--accent-deep); transform: translateY(-1px); }

.cta-primary .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-soft);
}

.cta-secondary {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-sec);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--border-strong);
}

.cta-secondary:hover { color: var(--accent-deep); }

/* staggered load reveal */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.reveal.d1 { animation-delay: 0.05s; }
.reveal.d2 { animation-delay: 0.15s; }
.reveal.d3 { animation-delay: 0.25s; }
.reveal.d4 { animation-delay: 0.35s; }
.reveal.d5 { animation-delay: 0.5s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
}

/* ---------- phone mockup ---------- */

.phone-col { display: flex; justify-content: center; }

.phone {
  width: 320px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 42px;
  padding: 14px;
  box-shadow:
    0 2px 4px rgba(38, 28, 18, 0.05),
    0 24px 48px -16px rgba(38, 28, 18, 0.22);
  transform: rotate(1.6deg);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.phone:hover { transform: rotate(0deg) translateY(-4px); }

.screen {
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 18px 16px 0;
}

.screen .app-title {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 10px 0 10px;
}

.stats-pill {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--text-sec);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  padding: 6px 12px;
  display: inline-block;
  margin-bottom: 14px;
}

.activity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 12px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.activity-card .meta { flex: 1; min-width: 0; }

.activity-card .name {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-card .sub {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  color: var(--text-ter);
  margin-top: 2px;
}

.refl-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  flex-shrink: 0;
}

.refl-dot.filled { background: var(--accent); }

.tabbar {
  display: flex;
  border-top: 1px solid var(--border);
  margin: 10px -16px 0;
  background: var(--surface);
}

.tabbar div {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 12px 0 16px;
  color: var(--text-ter);
}

.tabbar .active { color: var(--accent); }

/* ---------- problem strip ---------- */

.problem {
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 72px 0;
}

.problem blockquote {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.015em;
  line-height: 1.25;
  max-width: 22ch;
  margin-bottom: 40px;
}

.problem blockquote strong { color: var(--accent-deep); font-weight: 500; }

.pain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }

.pain h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.pain p { font-size: 15px; color: var(--text-sec); }

.pain .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-ter);
  display: block;
  margin-bottom: 10px;
}

/* ---------- how it works ---------- */

.how { padding: 96px 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 26px 24px 28px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.step:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 28px -14px rgba(38, 28, 18, 0.25);
}

.step .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: var(--btn-radius);
  padding: 4px 11px;
  display: inline-block;
  margin-bottom: 18px;
}

.step h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.step p { font-size: 15px; color: var(--text-sec); }

/* ---------- free / AI split ---------- */

.split { padding: 0 0 96px; }

.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.tier {
  border-radius: var(--card-radius);
  padding: 32px 30px 36px;
  border: 1px solid var(--border);
}

.tier.build { background: var(--surface); }

.tier.apply {
  background: var(--accent-ink);
  color: #f0fdfa;
  border-color: var(--accent-deep);
}

.tier .tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.tier.build .tag { color: var(--accent-deep); }
.tier.apply .tag { color: #99f6e4; }

.tier h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}

.tier p { font-size: 15px; margin-bottom: 20px; }
.tier.build p { color: var(--text-sec); }
.tier.apply p { color: #ccfbf1; }

.tier ul { list-style: none; }

.tier li {
  font-size: 15px;
  padding: 9px 0;
  display: flex;
  gap: 11px;
  align-items: baseline;
}

.tier.build li { border-top: 1px solid var(--divider); color: var(--text); }
.tier.apply li { border-top: 1px solid rgba(204, 251, 241, 0.15); }

.tier li::before {
  content: "✓";
  font-family: var(--mono);
  font-size: 12px;
  flex-shrink: 0;
}

.tier.build li::before { color: var(--accent); }
.tier.apply li::before { color: #5eead4; }

/* ---------- audience ---------- */

.who { padding: 0 0 110px; }

.who-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.who-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 20px 18px;
}

.who-card .label {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 5px;
}

.who-card .detail {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-ter);
}

/* ---------- closing ---------- */

.closing {
  text-align: center;
  padding: 0 0 110px;
}

.closing h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  max-width: 20ch;
  margin: 0 auto 18px;
}

.closing p {
  color: var(--text-sec);
  max-width: 44ch;
  margin: 0 auto 30px;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 36px 0 44px;
}

.foot-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.foot-left { display: flex; align-items: center; gap: 10px; }
.foot-left img { width: 22px; height: auto; opacity: 0.85; }

.foot-left span {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
}

.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }

.foot-links a {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-sec);
  text-decoration: none;
}

.foot-links a:hover { color: var(--accent-deep); }

.foot-copy {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-ter);
}

/* ---------- legal pages ---------- */

.legal { max-width: 720px; margin: 0 auto; padding: 48px 24px 110px; }

.legal h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.legal .updated {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-ter);
  margin-bottom: 44px;
  display: block;
}

.legal h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 38px 0 10px;
  letter-spacing: -0.01em;
}

.legal p, .legal li { font-size: 16px; color: var(--text-sec); }

.legal p { margin-bottom: 14px; }

.legal ul { padding-left: 22px; margin-bottom: 14px; }

.legal li { margin-bottom: 10px; }

.legal strong { color: var(--text); font-weight: 600; }

/* ---------- responsive ---------- */

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding: 40px 0 72px; gap: 56px; }
  .hero::before { inset: 24px 0 48px -40px; }
  .pain-grid, .steps { grid-template-columns: 1fr; }
  .split-grid { grid-template-columns: 1fr; }
  .who-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .who-row { grid-template-columns: 1fr; }
  .nav-right .nav-link { display: none; }
}

/* FAQ */
.faq { padding-top: 24px; padding-bottom: 24px; }
.faq-list { margin-top: 22px; border-top: 1px solid var(--divider); }
.faq-item { border-bottom: 1px solid var(--divider); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative;
  font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 4px; top: 18px;
  font-family: var(--mono); font-size: 22px; color: var(--accent-deep); transition: transform .2s ease;
}
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { color: var(--text-sec); line-height: 1.7; padding: 0 0 22px; max-width: 70ch; }
.faq-item a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }

/* Blog list */
.blog-list { display: grid; gap: 18px; padding-top: 28px; padding-bottom: 8px; }
.post-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--card-radius); padding: 26px 28px; text-decoration: none; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: 0 10px 30px rgba(38,28,18,.07); }
.post-cat, .article-cat { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); }
.post-card h2, .post-card h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.3px; margin: 10px 0 8px; }
.post-card p { color: var(--text-sec); line-height: 1.6; }

/* Article */
.article { max-width: 720px; padding-top: 40px; padding-bottom: 8px; }
.article > h1 { font-family: var(--serif); font-size: clamp(30px, 5vw, 46px); font-weight: 600; line-height: 1.1; letter-spacing: -.5px; margin: 12px 0 28px; }
.article-cat { margin-bottom: 4px; }
.article-body { font-size: 18px; line-height: 1.75; color: var(--text); }
.article-body h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -.3px; margin: 38px 0 12px; }
.article-body p { margin-bottom: 18px; color: var(--text-sec); }
.article-body ul { margin: 0 0 18px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; color: var(--text-sec); line-height: 1.65; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }

.blog-section-head { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-ter); margin: 36px 0 4px; }
