/* =========================================================
   SavorgStudio — editorial minimal
   Shared styles across all pages
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }

:root {
  /* Paper warm, ink cool. The temperature contrast is the authored move. */
  --ink:      oklch(0.18 0.014 250);
  --charcoal: oklch(0.26 0.014 250);
  --graphite: oklch(0.46 0.012 250);
  --steel:    oklch(0.62 0.008 250);
  --fog:      oklch(0.92 0.005 250);
  --mist:     oklch(0.965 0.004 75);
  --paper:    oklch(0.985 0.005 75);

  --focus:    oklch(0.55 0.18 250);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 10vw, 9rem);
  --container: 1180px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Visible, consistent focus ring for keyboard users. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto; height: auto;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  z-index: 100;
}

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

h1, h2, h3, h4 { font-family: var(--font-sans); color: var(--ink); letter-spacing: -0.02em; }
h1 { font-weight: 700; font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-weight: 700; font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.1; letter-spacing: -0.03em; }
h3 { font-weight: 600; font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.01em; }

.kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite);
}
.kicker--block { display: inline-block; margin-bottom: 0.75rem; }

.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--graphite);
  max-width: 44ch;
}

.eyebrow-rule {
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: var(--graphite);
  vertical-align: middle;
  margin-right: 0.75rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--fog); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem var(--gutter);
  max-width: var(--container);
  margin: 0 auto;
}

.brand { display: inline-flex; align-items: center; gap: 0.55rem; }
.brand-mark { height: 32px; width: auto; display: block; }
.brand-wordmark { height: 22px; width: auto; display: block; }
.footer-brand .brand-mark { height: 28px; }
.footer-brand .brand-wordmark { height: 20px; }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav a {
  position: relative;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--graphite);
  transition: color 0.2s var(--ease);
  padding: 0.25rem 0;
}
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
}

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  position: relative;
  margin-right: -10px;
}
.nav-toggle::before, .nav-toggle::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  height: 1.5px;
  background: var(--ink);
  transition: top 0.25s var(--ease), transform 0.25s var(--ease);
}
.nav-toggle::before { top: 19px; }
.nav-toggle::after  { top: 25px; }
body.menu-open .nav-toggle::before { top: 22px; transform: rotate(45deg); }
body.menu-open .nav-toggle::after  { top: 22px; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .nav {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    background: var(--paper);
    border-bottom: 1px solid var(--fog);
    padding: 1.5rem var(--gutter) 2rem;
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
  }
  .nav a { font-size: 1.6rem; font-weight: 600; color: var(--ink); padding: 0.6rem 0; }
  body.menu-open .nav { transform: translateY(0); }
  .nav-toggle { display: block; }
}

/* Hero */
.hero {
  padding: clamp(6rem, 14vw, 10rem) 0 clamp(4rem, 10vw, 8rem);
  border-bottom: 1px solid var(--fog);
}
.hero .kicker { margin-bottom: 2rem; }
.hero h1 { max-width: 18ch; margin-bottom: 1.75rem; }
.hero .lede { margin-bottom: 2.5rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--charcoal); transform: translateY(-1px); }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  background: var(--steel);
  cursor: progress;
  transform: none;
}
.btn-ghost { color: var(--ink); padding-left: 0.25rem; padding-right: 0.25rem; }
.btn-ghost .arrow { transition: transform 0.25s var(--ease); }
.btn-ghost:hover .arrow { transform: translateX(4px); }

/* Sections */
.section { padding: var(--section-y) 0; border-bottom: 1px solid var(--fog); }
.section-head { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 3rem; max-width: 54ch; }
.section-head .kicker { margin-bottom: 0.5rem; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.5rem, 3vw, 3rem); }
.grid-2--top { align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 3rem); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Project cards */
.project-card {
  padding: 0;
  background: none;
  border-top: 1px solid var(--fog);
  padding-top: 2rem;
  margin-bottom: 2.5rem;
}
.project-card h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.project-card p { color: var(--graphite); max-width: 52ch; }
.project-card .meta-row {
  display: flex; gap: 1.75rem; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--steel); letter-spacing: 0.04em; text-transform: uppercase;
  margin-top: 1.5rem;
}

/* Manifesto block — used for empty states like portfolio-before-launch */
.manifesto {
  max-width: 32ch;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: var(--ink);
}
.manifesto + .manifesto-foot {
  margin-top: 2.5rem;
  font-size: 0.95rem;
  color: var(--graphite);
  max-width: 44ch;
}

/* Principles row */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 4vw, 4rem); }
.principle .number {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; color: var(--steel); text-transform: uppercase;
  margin-bottom: 1.25rem; display: block;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--fog);
}
.principle h3 { margin-bottom: 0.75rem; }
.principle p { color: var(--graphite); }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; gap: 2.5rem; } }

/* Contact form */
.contact-form { display: grid; gap: 1.25rem; max-width: 520px; }
.contact-form label {
  display: grid; gap: 0.5rem;
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--graphite); font-weight: 600;
}
.contact-form input, .contact-form textarea {
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--fog);
  border-radius: 10px;
  background: var(--paper);
  font-size: 1rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  font-weight: 400;
  transition: border-color 0.2s var(--ease);
}
.contact-form input:hover, .contact-form textarea:hover { border-color: var(--steel); }
.contact-form input:focus-visible, .contact-form textarea:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 18%, transparent);
}
.contact-form textarea { min-height: 140px; resize: vertical; }

.contact-form input[aria-invalid="true"],
.contact-form textarea[aria-invalid="true"] {
  border-color: oklch(0.55 0.16 25);
}
.contact-form .field-error {
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  color: oklch(0.5 0.16 25);
  margin-top: -0.25rem;
}
.contact-form .form-note {
  font-size: 0.88rem;
  color: var(--graphite);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}
.contact-form .form-note.is-error { color: oklch(0.5 0.16 25); }

/* Info list */
.info-list { display: grid; gap: 1.25rem; max-width: 540px; }
.info-item { display: grid; grid-template-columns: 140px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--fog); }
.info-item dt { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--graphite); font-weight: 600; }
.info-item dd { font-size: 1rem; color: var(--ink); display: inline-flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.info-item a { border-bottom: 1px solid var(--ink); padding-bottom: 1px; }

.copy-email {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--fog);
  border-radius: 999px;
  background: transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.copy-email:hover { color: var(--ink); border-color: var(--steel); }
.copy-email.is-copied { color: var(--ink); border-color: var(--ink); background: var(--mist); }
@media (max-width: 520px) { .info-item { grid-template-columns: 1fr; gap: 0.25rem; } }

/* Footer */
.site-footer { background: var(--paper); padding: clamp(3rem, 6vw, 5rem) 0 2.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; padding-bottom: 3rem; border-bottom: 1px solid var(--fog); }
.footer-grid h3 { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--graphite); font-weight: 600; margin-bottom: 1.25rem; }
.footer-grid .footer-links { display: grid; gap: 0.6rem; }
.footer-grid .footer-links a { color: var(--ink); font-size: 0.95rem; transition: color 0.2s var(--ease); }
.footer-grid .footer-links a:hover { color: var(--graphite); }
.footer-brand p { color: var(--graphite); max-width: 32ch; margin-top: 1rem; font-size: 0.95rem; }
.footer-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 2rem;
  font-size: 0.8rem; color: var(--steel);
  letter-spacing: 0.02em;
}
.footer-meta .sep { margin: 0 0.5rem; color: var(--fog); }
.footer-privacy { color: var(--steel); transition: color 0.2s var(--ease); }
.footer-privacy:hover { color: var(--graphite); }

/* Privacy page: at-a-glance table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-top: 1rem; }
.data-table th, .data-table td { text-align: left; padding: 0.85rem 0.75rem 0.85rem 0; vertical-align: top; border-bottom: 1px solid var(--fog); }
.data-table th { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--graphite); font-weight: 600; border-bottom: 1px solid var(--graphite); }
.data-table td { color: var(--graphite); }
.data-table td:first-child { color: var(--ink); font-weight: 500; }
@media (max-width: 640px) {
  .data-table, .data-table thead, .data-table tbody, .data-table tr, .data-table th, .data-table td { display: block; }
  .data-table thead { display: none; }
  .data-table tr { padding: 1rem 0; border-bottom: 1px solid var(--fog); }
  .data-table td { padding: 0.15rem 0; border: none; font-size: 0.95rem; }
  .data-table td:first-child { font-size: 1rem; margin-bottom: 0.25rem; }
  .data-table td:not(:first-child)::before { content: attr(data-label) " — "; color: var(--steel); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; margin-right: 0.4rem; }
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; } .footer-meta { flex-direction: column; gap: 1rem; align-items: flex-start; } }

/* Reveal on scroll, gracefully degrades without JS */
html.has-js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
html.has-js .reveal.is-visible { opacity: 1; transform: none; }

/* Privacy long-form layout */
.prose-narrow { max-width: 820px; margin: 0 auto; }
.prose-block { margin-bottom: 2.5rem; scroll-margin-top: 5rem; }
.prose-block p + p { margin-top: 1rem; }
.prose-block ul.bullet-list { list-style: disc; padding-left: 1.5rem; margin-top: 0.75rem; color: var(--graphite); }
.prose-block ul.bullet-list li { margin-bottom: 0.4rem; }
.prose-foot { border-top: 1px solid var(--fog); padding-top: 1.5rem; margin-top: 2rem; }

.prose-toc {
  margin-bottom: 3.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--fog);
}
.prose-toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 2rem;
  counter-reset: toc;
  font-size: 0.95rem;
}
.prose-toc li { counter-increment: toc; display: flex; gap: 0.75rem; }
.prose-toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--steel);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding-top: 0.2rem;
  flex-shrink: 0;
}
.prose-toc a {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
  padding-bottom: 1px;
}
.prose-toc a:hover { border-bottom-color: var(--ink); }
@media (max-width: 640px) {
  .prose-toc ol { grid-template-columns: 1fr; gap: 0.55rem; }
}

/* Utilities */
.muted { color: var(--graphite); }
.small { font-size: 0.88rem; }
.measure-narrow { max-width: 60ch; }
.link-inline { border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.stack-lg { margin-top: 3rem; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-wrap { position: relative; overflow: hidden; }

/* Shared app auth callback page */
.auth-callback-page {
  min-height: 100vh;
  display: grid;
  background: var(--paper);
}
.auth-callback {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: var(--gutter);
}
.auth-callback__inner {
  width: min(100%, 560px);
  margin: 0 auto;
}
.auth-callback h1 {
  font-size: clamp(2.3rem, 8vw, 4.5rem);
  max-width: 10ch;
  margin: 1rem 0 1.2rem;
}
.auth-callback .lede {
  margin-bottom: 2rem;
}
.auth-callback__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
