/* ==========================================================================
   AfterNow — Editorial Design System
   ========================================================================== */

:root {
  /* Color palette */
  --bg: #f5f4ed;
  --surface: #faf9f5;
  --border: #e8e6dc;
  --text: #141413;
  --text-secondary: #4d4c48;
  --text-muted: #5e5d59;
  --text-subtle: #87867f;
  --accent: #c96442;
  --accent-hover: #b5542f;
  --accent-light: rgba(201, 100, 66, 0.10);

  /* Type */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Layout */
  --content-width: 900px;
  --article-width: 680px;
  --radius: 12px;
  --radius-sm: 6px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 244, 237, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: block;
  width: 140px;
  height: 36px;
  background-image: url('../images/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
  text-indent: -9999px;
  overflow: hidden;
}

.nav-logo:hover {
  opacity: 0.85;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover { color: var(--text); }

.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav-cta {
  font-family: var(--font-sans);
  font-size: 14px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover { border-color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}

.btn-ghost:hover { color: var(--text); }

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- Overline / section labels ---- */
.overline {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

/* ---- Hero ---- */
.hero {
  padding: 120px 0 80px;
}

.hero .overline { margin-bottom: 20px; display: block; }

.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  max-width: 780px;
  margin-bottom: 24px;
}

.hero h1 .accent { color: var(--accent); }

.hero-sub {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* ---- Hero flow diagram ---- */
.flow-diagram {
  margin-top: 56px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flow-steps {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 14px;
}

.flow-step {
  padding: 12px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.flow-arrow { color: var(--text-subtle); font-size: 16px; }

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 16px;
  background: var(--accent-light);
  border: 1px solid rgba(201, 100, 66, 0.25);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

/* ---- Sections ---- */
.section {
  padding: 80px 0;
}

.section-border {
  border-top: 1px solid var(--border);
}

.section-surface {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 24px;
  max-width: 760px;
}

.section-body {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.75;
}

.section-body p + p { margin-top: 1.2em; }

.section-intro { margin-bottom: 56px; }

/* ---- Card grids ---- */
.grid {
  display: grid;
  gap: 24px;
  margin-top: 48px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #d8d5c8;
}

.card-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.card h3 {
  font-size: 19px;
  margin-bottom: 10px;
}

.card p {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
}

.card-list { display: flex; flex-direction: column; gap: 16px; margin-top: 48px; }

.card-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: border-color 0.18s ease;
}

.card-row:hover { border-color: #d8d5c8; }

.card-row .card-number { margin-bottom: 0; flex-shrink: 0; padding-top: 3px; }

.card-row-body h3 { font-size: 18px; margin-bottom: 6px; }

.card-row-body p { font-size: 14px; font-weight: 300; color: var(--text-muted); line-height: 1.65; margin-bottom: 10px; }

/* ---- Tags ---- */
.mono-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.mono-tag.accent {
  color: var(--accent);
  background: var(--accent-light);
  border-color: rgba(201, 100, 66, 0.25);
}

/* ---- Pullquote ---- */
.pullquote {
  margin: 56px 0 0;
  padding-left: 28px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 24px;
  color: var(--text);
  max-width: 640px;
}

.pullquote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
  color: var(--text-subtle);
}

/* ---- Stats ---- */
.stats {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 180px;
}

/* ---- CTA section ---- */
.cta-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 96px 0;
  text-align: center;
}

.cta-section h2 { margin: 0 auto 16px; }

.cta-section .section-body {
  margin: 0 auto 36px;
  text-align: center;
}

.cta-section .cta-row { justify-content: center; }

/* ---- Code block ---- */
.code-block {
  background: #141413;
  color: #e8e6dc;
  border-radius: var(--radius);
  padding: 24px 28px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
  margin-top: 32px;
}

.code-block .comment { color: #87867f; }
.code-block .string { color: #d9a37a; }
.code-block .prompt { color: #c96442; }

/* ---- Key points list ---- */
.key-points {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 32px;
}

.key-point {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.key-point-marker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
  padding-top: 2px;
}

.key-point p {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.65;
}

/* ---- Device table/cards ---- */
.device-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.device-name { font-family: var(--font-serif); font-size: 18px; }

.device-spec { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.device-privacy {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
}

.device-meta { flex: 1; min-width: 200px; }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  display: block;
  width: 140px;
  height: 36px;
  background-image: url('../images/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
  text-indent: -9999px;
  overflow: hidden;
}

.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-links a:hover { color: var(--text); }

.footer-copy {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 24px;
}

/* ---- About page ---- */
.team-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 1px solid rgba(201, 100, 66, 0.25);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.team-card h3 { font-size: 18px; margin-bottom: 2px; }

.team-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 14px;
  display: block;
}

.team-bio {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.team-links { display: flex; gap: 16px; }

.team-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.team-links a:hover { color: var(--accent); border-color: var(--accent); }

.prose { max-width: var(--article-width); }

.prose p {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5em;
}

/* ---- Contact page ---- */
.contact-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 120px 32px 100px;
  text-align: center;
}

.contact-page h1 {
  font-size: clamp(36px, 5vw, 48px);
  margin-bottom: 20px;
}

.contact-page > .section-body {
  margin: 0 auto 56px;
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: left;
  margin-bottom: 48px;
}

.contact-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.contact-item .overline { margin-bottom: 10px; display: block; }

.contact-item a, .contact-item span.value {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text);
}

.contact-item a:hover { color: var(--accent); }

.social-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.social-row a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}

.social-row a:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Blog index ---- */
.blog-hero { padding: 100px 0 56px; }

.blog-hero h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 16px; }

.post-list {
  display: flex;
  flex-direction: column;
}

.post-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

.post-row:last-child { border-bottom: 1px solid var(--border); }

.post-row:hover { opacity: 0.75; }

.post-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-subtle);
}

.post-main a { display: block; }

.post-title {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-bottom: 8px;
}

.post-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.6;
  max-width: 540px;
}

.blog-note {
  margin-top: 48px;
  font-size: 13px;
  color: var(--text-subtle);
  text-align: center;
  font-style: italic;
}

/* ---- Article page ---- */
.article { padding: 64px 0 100px; }

.article-back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.article-back:hover { color: var(--accent); }

.article-overline {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-subtle);
  margin-bottom: 20px;
  max-width: var(--article-width);
}

.article h1 {
  font-size: clamp(32px, 5vw, 48px);
  max-width: var(--article-width);
  margin-bottom: 40px;
}

.article-hero-img {
  width: 100%;
  max-width: var(--article-width);
  height: 320px;
  border-radius: var(--radius);
  margin-bottom: 48px;
  background: linear-gradient(135deg, #e8e6dc 0%, #d8d5c8 50%, #c9c5b4 100%);
  position: relative;
  overflow: hidden;
}

.article-hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 30%, rgba(201,100,66,0.18), transparent 45%),
    radial-gradient(circle at 75% 70%, rgba(20,20,19,0.08), transparent 50%);
}

.article-body {
  max-width: var(--article-width);
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  font-weight: 300;
}

.article-body p { margin-bottom: 1.5em; }

.article-body h2 {
  font-size: 26px;
  color: var(--text);
  margin: 2em 0 0.7em;
}

.article-body h3 {
  font-size: 20px;
  color: var(--text);
  margin: 1.8em 0 0.6em;
}

.article-body strong { color: var(--text); font-weight: 500; }

.article-body ul, .article-body ol {
  margin: 0 0 1.5em 0;
  padding-left: 24px;
  list-style: disc;
}

.article-body ol { list-style: decimal; }

.article-body li { margin-bottom: 0.5em; }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 24px;
  margin: 2em 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  color: var(--text);
}

.article-body pre {
  background: #141413;
  color: #e8e6dc;
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 2em 0;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 14px;
}

.article-body p code, .article-body li code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.article-tags {
  display: flex;
  gap: 10px;
  margin: 48px 0 32px;
  max-width: var(--article-width);
  flex-wrap: wrap;
}

.article-share {
  display: flex;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: var(--article-width);
  margin-bottom: 48px;
}

.article-share a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.article-share a:hover { color: var(--accent); }

.author-bio {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  max-width: var(--article-width);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 1px solid rgba(201, 100, 66, 0.25);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-name { font-family: var(--font-serif); font-size: 18px; }

.author-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin: 4px 0 10px;
  display: block;
}

.author-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.post-nav {
  display: flex;
  justify-content: space-between;
  max-width: var(--article-width);
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-subtle);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .nav-links { display: none; }

  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 20px 20px;
  }

  .nav-links.open a {
    padding: 12px 0;
    width: 100%;
    border-bottom: none;
  }

  .nav-toggle { display: block; }

  .hero { padding: 80px 0 56px; }

  .section { padding: 56px 0; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }

  .flow-steps { flex-direction: column; align-items: flex-start; }

  .flow-arrow { transform: rotate(90deg); }

  .contact-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  .post-row { grid-template-columns: 1fr; gap: 8px; }

  .device-card { flex-direction: column; align-items: flex-start; }

  .author-bio { flex-direction: column; }
}
