@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..600;1,9..144,400..600&family=Geist:wght@400;500;600&display=swap');

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  /* Palette — two neutrals, one brand, one accent.
     Sections alternate between --paper and --paper-deep for rhythm. */
  --ink:        #131311;
  --forest:     #143829;
  --terracotta: #B04A28;
  --paper:      #FAF6EB;  /* base */
  --paper-soft: #FDFBF5;  /* hero */
  --paper-deep: #EDE4CC;  /* alternate sections */
  --paper-deeper:#E2D7B8; /* footer */
  --stone:      #575751;  /* body/muted text — ~6.2:1 on paper, AA+ */
  --rule:       #D7CCB0;

  /* Type scale */
  --h1-size:   clamp(2.75rem, 6vw, 4.75rem);
  --h2-size:   clamp(1.875rem, 3.4vw, 2.625rem);
  --h3-size:   1.25rem;
  --body-size: 1.0625rem;       /* 17px */
  --lead-size: clamp(1.25rem, 2vw, 1.5rem);

  /* Motion */
  --ease:     cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur:      240ms;

  /* Layout */
  --container: 1100px;
  --pad-x:     1.25rem;
  --z-header:  20;
  --z-skip:    100;
}

@media (min-width: 640px) { :root { --pad-x: 1.75rem; } }
@media (min-width: 960px) { :root { --pad-x: 2.25rem; } }

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0; padding: 0;
}
ul, ol { list-style: none; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ==========================================================================
   Base
   ========================================================================== */
body {
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--body-size);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Barely-there paper texture — single overlay, very subtle. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url('/assets/noise.svg');
  background-repeat: repeat;
  background-size: 120px 120px;
  opacity: 0.025;
  z-index: -1;
}

h1 {
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--h1-size);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

h2 {
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--h2-size);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h3 {
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--h3-size);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.65;
}

/* The three italic accents allowed site-wide — rendered in terracotta. */
.hero__title em,
.studio__title em,
.contact-email__addr em {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-variation-settings: 'opsz' 72;
  color: var(--terracotta);
}

a {
  color: var(--forest);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color var(--dur-fast) var(--ease),
              text-decoration-color var(--dur-fast) var(--ease);
}
a:hover { text-decoration: underline; text-decoration-color: var(--forest); }

.eyebrow {
  display: inline-block;
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--forest);
  margin-bottom: 0.875rem;
}

:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}

.skip-link {
  position: absolute;
  top: 0; left: 0;
  transform: translateY(-120%);
  background: var(--forest);
  color: var(--paper-soft);
  padding: 0.75rem 1.25rem;
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  border-bottom-right-radius: 4px;
  z-index: var(--z-skip);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus, .skip-link:focus-visible { transform: translateY(0); outline: none; text-decoration: none; }

/* ==========================================================================
   Site header
   ========================================================================== */
.site-header {
  padding-block: 1.25rem;
  z-index: var(--z-header);
}

@media (min-width: 960px) {
  .site-header { padding-block: 1.75rem; }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--forest); }
.brand img { width: auto; height: 28px; flex-shrink: 0; }

@media (min-width: 640px) {
  .brand img { height: 32px; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9375rem;
}
.site-nav a { color: var(--stone); padding-block: 0.25rem; }
.site-nav a:hover { color: var(--forest); text-decoration: none; }

@media (max-width: 520px) {
  .site-nav { gap: 1rem; font-size: 0.875rem; }
}

/* ==========================================================================
   Section rhythm
   ========================================================================== */
main > section {
  padding-block: 3.5rem;
  position: relative;
}

@media (min-width: 640px) { main > section { padding-block: 5rem; } }
@media (min-width: 960px) { main > section { padding-block: 7rem; } }

/* Alternating section backgrounds define the rhythm.
   Hero stays on the default --paper; product & contact are deeper. */
main > section#hero     { background: var(--paper-soft); }
main > section#product  { background: var(--paper-deep); }
main > section#studio   { background: var(--paper); }
main > section#contact  { background: var(--paper-deep); }

/* ==========================================================================
   Hero
   ========================================================================== */
main > section#hero {
  padding-block: clamp(3rem, 9vw, 7rem);
}

.hero__title {
  max-width: 16ch;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(14px);
  animation: heroRise 900ms var(--ease) 120ms forwards;
}

.hero__lead {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-variation-settings: 'opsz' 36;
  font-size: var(--lead-size);
  line-height: 1.45;
  color: var(--stone);
  max-width: 34ch;
  opacity: 0;
  transform: translateY(14px);
  animation: heroRise 900ms var(--ease) 320ms forwards;
}

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

/* ==========================================================================
   Product
   ========================================================================== */
.product__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .product__layout {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }
}

.product__copy { max-width: 42ch; }

.product__headline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.product__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.product__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--stone);
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: 0.01em;
}

.product__status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--terracotta);
  display: inline-block;
  flex-shrink: 0;
  /* Subtle breathing — the only continuous decorative animation. */
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.product__description {
  color: var(--stone);
  line-height: 1.7;
  margin-bottom: 1.75rem;
  max-width: 42ch;
}

.product__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--forest);
  padding-block: 0.25rem;
}
.product__link:hover { text-decoration: none; }
.product__link-text { border-bottom: 1px solid transparent; transition: border-color var(--dur) var(--ease); }
.product__link:hover .product__link-text { border-bottom-color: var(--forest); }
.product__link-arrow { transition: transform var(--dur) var(--ease); }
.product__link:hover .product__link-arrow { transform: translateX(4px); }

.product__visual {
  justify-self: center;
  max-width: 360px;
  width: 100%;
}

.product__visual img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(10, 14, 12, 0.06),
    0 12px 28px -18px rgba(10, 14, 12, 0.25),
    0 24px 60px -32px rgba(20, 56, 41, 0.18);
}

@media (min-width: 900px) {
  .product__visual { max-width: none; }
}

/* ==========================================================================
   Studio (about + principles, merged)
   ========================================================================== */
.studio__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 900px) {
  .studio__layout {
    grid-template-columns: 1.1fr 1fr;
    gap: 5rem;
    align-items: start;
  }
}

.studio__title {
  max-width: 14ch;
  margin-bottom: 1.75rem;
}

.studio__prose p {
  color: var(--stone);
  line-height: 1.7;
  max-width: 42ch;
}
.studio__prose p + p { margin-top: 1rem; }

.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 520px) {
  .principles { grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; }
}

.principles__item {
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.principles__num {
  display: block;
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--stone);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.principles__item h3 {
  margin-bottom: 0.375rem;
}

.principles__item p {
  color: var(--stone);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
}

@media (min-width: 900px) {
  .contact__layout {
    grid-template-columns: 1.1fr 1fr;
    gap: 4.5rem;
    align-items: center;
  }
}

.contact__title {
  margin-bottom: 1rem;
  max-width: 14ch;
}

.contact__sub {
  color: var(--stone);
  max-width: 42ch;
  line-height: 1.6;
}

.contact__actions {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--forest);
  font-size: clamp(1.5rem, 3.6vw, 2.25rem);
  line-height: 1.1;
  padding-block: 0.25rem;
  width: max-content;
  max-width: 100%;
}
.contact-email:hover { text-decoration: none; }

.contact-email__addr {
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.contact-email:hover .contact-email__addr,
.contact-email:focus-visible .contact-email__addr { border-bottom-color: var(--forest); }

.contact-email__addr em { font-variation-settings: 'opsz' 96; }

.contact-email__arrow {
  font-size: 0.65em;
  color: var(--forest);
  transition: transform var(--dur) var(--ease);
}
.contact-email:hover .contact-email__arrow,
.contact-email:focus-visible .contact-email__arrow {
  transform: translateX(6px);
}

.contact__meta {
  display: grid;
  gap: 0.65rem;
  font-size: 0.9375rem;
}

.contact__meta-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding-block: 0.5rem;
  border-top: 1px solid var(--rule);
}

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

.contact__meta dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone);
  font-weight: 500;
  align-self: center;
}

.contact__meta dd {
  margin: 0;
  color: var(--ink);
  align-self: center;
}

#utah-time { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Site footer
   ========================================================================== */
.site-footer {
  background: var(--paper-deeper);
  padding-block: 2.25rem;
  color: var(--stone);
  font-size: 0.875rem;
  border-top: 3px solid var(--forest);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.site-footer__row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .site-footer__row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9375rem;
}
.site-footer__brand:hover { text-decoration: none; color: var(--forest); }
.site-footer__brand img { width: auto; height: 22px; }

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.site-footer__nav a {
  color: var(--stone);
  padding-block: 0.25rem;
}
.site-footer__nav a:hover { color: var(--forest); text-decoration: none; }

.site-footer__base {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--stone);
}

@media (min-width: 640px) {
  .site-footer__base {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.site-footer__colophon {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-variation-settings: 'opsz' 24;
}

/* ==========================================================================
   Legal pages (privacy, terms)
   ========================================================================== */
.legal .prose {
  max-width: 680px;
  margin: 0 auto;
}

.legal .prose > .eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.legal .prose > h1 { margin-bottom: 2.5rem; }

.legal .prose section + section { margin-top: 2.25rem; }

.legal .prose section h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.legal .prose section p {
  margin-bottom: 1rem;
  color: var(--ink);
}

.legal .prose section p:last-child { margin-bottom: 0; }

.legal__summary {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 36;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink);
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  border-left: 3px solid var(--terracotta);
  background: var(--paper-soft);
  border-radius: 0 2px 2px 0;
}

.legal__summary strong { font-weight: 500; }

.legal .prose section ul {
  padding-left: 1.25rem;
  margin-block: 0.75rem 1rem;
  list-style: disc;
}

.legal .prose section ul li {
  margin-bottom: 0.4rem;
  color: var(--ink);
  list-style: disc;
}

.legal .prose section ul li:last-child { margin-bottom: 0; }

.legal .prose section a {
  color: var(--forest);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease);
}
.legal .prose section a:hover { border-bottom-color: var(--forest); text-decoration: none; }

/* Conspicuous legal clauses (warranty, liability) — UCC §2-316 compliance.
   Uppercase with tracking for readability. */
.legal__emphasis {
  font-size: 0.9375rem;
  line-height: 1.55;
  letter-spacing: 0.015em;
  color: var(--ink);
}
.legal__emphasis strong { font-weight: 600; }

/* ==========================================================================
   404 page
   ========================================================================== */
.not-found {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: 4rem;
}
.not-found .container { max-width: 640px; }
.not-found h1 { margin-bottom: 1.5rem; }
.not-found__lead {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 36;
  font-size: var(--lead-size);
  line-height: 1.45;
  color: var(--stone);
  max-width: 40ch;
  margin: 0 auto 2rem;
}
.not-found__back {
  display: inline-block;
  font-weight: 500;
  padding-block: 0.5rem;
}

/* ==========================================================================
   Scroll reveal — section fades + children stagger in
   ========================================================================== */
.fade-in {
  opacity: 0;
  transition: opacity 640ms var(--ease);
  will-change: opacity;
}
.fade-in.visible { opacity: 1; }

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
  will-change: opacity, transform;
}

.fade-in.visible .reveal {
  opacity: 1;
  transform: none;
}

/* Cascade children by their position among siblings in a product/contact
   column. Up to 6 siblings covered — product__copy has 5 revealing items. */
.fade-in.visible .reveal:nth-child(1) { transition-delay: 40ms; }
.fade-in.visible .reveal:nth-child(2) { transition-delay: 130ms; }
.fade-in.visible .reveal:nth-child(3) { transition-delay: 220ms; }
.fade-in.visible .reveal:nth-child(4) { transition-delay: 310ms; }
.fade-in.visible .reveal:nth-child(5) { transition-delay: 400ms; }
.fade-in.visible .reveal:nth-child(6) { transition-delay: 490ms; }

/* Principles list gets its own cascade so it doesn't inherit from the
   parent stagger chain — it starts fresh after the studio intro settles. */
.fade-in.visible .principles__item:nth-child(1) { transition-delay: 180ms; }
.fade-in.visible .principles__item:nth-child(2) { transition-delay: 260ms; }
.fade-in.visible .principles__item:nth-child(3) { transition-delay: 340ms; }
.fade-in.visible .principles__item:nth-child(4) { transition-delay: 420ms; }

/* Product screenshot scroll parallax (driven by --parallax from JS).
   Desktop + no-reduced-motion only — mobile/reduced-motion skip the
   translation for stability and preference. */
.product__visual img {
  transition: transform 0s;
}

@media (min-width: 900px) {
  .product__visual img {
    transform: translateY(var(--parallax, 0px));
  }
}

/* ==========================================================================
   Reduced motion — final override
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in { opacity: 1 !important; transform: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero__title, .hero__lead { opacity: 1 !important; transform: none !important; }
  .product__status .dot { animation: none !important; }
  .product__visual img { transform: none !important; }
}
