/* ==========================================================================
   Calm Flex Commerce — stylesheet
   ========================================================================== */

@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-latin.woff2') format('woff2');
  font-weight: 200 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'InterVar';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'InterVar', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --bg:        #FCFBF8;
  --bg-alt:    #F4F1EA;
  --bg-deep:   #EDE9E0;
  --ink:       #191815;
  --ink-soft:  #4F4B44;
  --muted:     #6C665C;
  --line:      #E2DDD2;
  --line-soft: #EDE9E0;
  --accent:    #3F5545;
  --accent-mid:#5C7362;
  --accent-pale:#E8EDE7;

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --section-y: clamp(4.5rem, 10vw, 8.5rem);

  --r-sm: 3px;
  --r-md: 6px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }

/* ---------- focus + skip link ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: .7rem 1.1rem; border-radius: var(--r-md);
  font-size: .8125rem; letter-spacing: .04em; text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 760px; }
.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- type scale ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: .6875rem; letter-spacing: .2em; text-transform: uppercase;
  font-weight: 500; color: var(--muted); margin: 0 0 1.5rem;
}
.eyebrow::before {
  content: ''; width: 26px; height: 1px; background: var(--accent-mid); flex: none;
}
.eyebrow--plain::before { display: none; }

.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 6.2vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
}
.h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
}
.h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3125rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.lede {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.68;
  color: var(--ink-soft);
  max-width: 40ch;
}
.body-text { color: var(--ink-soft); }
.small { font-size: .875rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--sans); font-size: .875rem; font-weight: 450;
  letter-spacing: .01em; text-decoration: none; cursor: pointer;
  padding: .95rem 1.6rem; border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background-color .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), transform .25s var(--ease);
}
.btn__arrow { transition: transform .3s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #34483A; }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); background: rgba(25,24,21,.03); }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn__arrow { transition: none; }
}

.link-underline {
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--accent-mid), var(--accent-mid));
  background-size: 100% 1px; background-repeat: no-repeat; background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size .3s var(--ease);
}
.link-underline:hover { background-size: 0% 1px; background-position: 100% 100%; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(252,251,248,.86);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 74px;
}
.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--ink);
}
.brand__mark { flex: none; width: 22px; height: 22px; color: var(--accent); }
.brand__text {
  font-size: .75rem; font-weight: 500; letter-spacing: .19em; text-transform: uppercase;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(1.25rem, 2.6vw, 2.4rem); }
.nav a {
  font-size: .8125rem; letter-spacing: .05em; color: var(--ink-soft);
  text-decoration: none; padding: .35rem 0; position: relative;
  transition: color .2s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--accent-mid); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle {
  display: none; background: none; border: 0; padding: .5rem; cursor: pointer;
  color: var(--ink); margin-right: -.5rem;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1.5rem;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--line-soft); font-size: .9375rem; }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(4rem, 11vw, 8.5rem) clamp(4rem, 9vw, 7rem);
  background:
    radial-gradient(120% 90% at 82% 8%, rgba(232,237,231,.85) 0%, rgba(252,251,248,0) 62%),
    linear-gradient(180deg, #FCFBF8 0%, #F7F4ED 100%);
  border-bottom: 1px solid var(--line-soft);
}
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2.5rem, 6vw, 5rem); align-items: center;
}
.hero__copy { max-width: 560px; }
.hero .display { margin-bottom: 1.6rem; max-width: 13ch; }
.hero .lede { margin-bottom: 2.4rem; max-width: 44ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .875rem; }
.hero__meta {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .5rem 1.75rem;
  font-size: .75rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}
.hero__art { position: relative; }
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 460px; }
  .hero__copy { max-width: none; }
  .hero .display { max-width: 15ch; }
}

/* ---------- section headers ---------- */
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem); align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head__aside { padding-bottom: .35rem; }
@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; align-items: start; }
}

/* ---------- badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .625rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-pale);
  border-radius: 100px; padding: .32rem .7rem .3rem;
  white-space: nowrap;
}
.badge__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-mid); flex: none; }

/* ---------- product cards ---------- */
.products { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 900px) { .products { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px)  { .products { grid-template-columns: 1fr; max-width: 380px; margin-inline: auto; } }

.product { display: flex; flex-direction: column; }
.product__cover {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-deep); border: 1px solid var(--line);
  aspect-ratio: 4 / 5; margin-bottom: 1.5rem;
}
.product__cover img { width: 100%; height: 100%; object-fit: cover; }
.product__badge { position: absolute; top: .875rem; left: .875rem; background: rgba(252,251,248,.92); }
.product__title { margin-bottom: .625rem; }
.product__desc { color: var(--ink-soft); font-size: .9375rem; line-height: 1.68; margin-bottom: 1.25rem; }
.product__meta {
  margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-size: .75rem; letter-spacing: .11em; text-transform: uppercase; color: var(--muted);
}
.product__status { color: var(--accent); }

.note {
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.75rem;
  border-top: 1px solid var(--line);
  font-size: .875rem; color: var(--muted); max-width: 62ch;
}

/* ---------- about ---------- */
.about__grid {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 5rem);
}
.about__body > * + * { margin-top: 1.4rem; }
@media (max-width: 820px) { .about__grid { grid-template-columns: 1fr; } }

/* ---------- approach ---------- */
.approach { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(2rem, 4vw, 3.5rem); }
@media (max-width: 820px) { .approach { grid-template-columns: 1fr; gap: 2.5rem; } }
.approach__item { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.approach__num {
  font-family: var(--serif); font-size: .875rem; color: var(--accent-mid);
  letter-spacing: .06em; display: block; margin-bottom: 1.1rem;
}
.approach__item h3 { margin-bottom: .75rem; }
.approach__item p { color: var(--ink-soft); font-size: .9375rem; }

/* ---------- contact ---------- */
.contact__inner { text-align: center; max-width: 620px; margin-inline: auto; }
.contact__inner .lede { margin-inline: auto; margin-block: 1.5rem 2.5rem; max-width: 46ch; }
.contact__email {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.5rem, 3.6vw, 2.25rem); letter-spacing: -0.015em;
  text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line); padding-bottom: .35rem;
  transition: border-color .3s var(--ease), color .3s var(--ease);
  display: inline-block; word-break: break-word;
}
.contact__email:hover { border-color: var(--accent); color: var(--accent); }
.contact__detail {
  margin-top: 2.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2rem;
  font-size: .75rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink); color: #D9D5CC;
  padding-block: clamp(3.5rem, 7vw, 5.5rem) 2.5rem;
  font-size: .875rem;
}
.footer__grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 3rem;
}
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; gap: 2.5rem; } }
.footer__brand { display: inline-flex; align-items: center; gap: .7rem; color: #F5F2EC; text-decoration: none; margin-bottom: 1.4rem; }
.footer__brand .brand__mark { color: #9FB3A4; }
.footer__brand .brand__text { color: #F5F2EC; }
.footer__addr { font-style: normal; color: #A8A399; line-height: 1.85; }
.footer__addr a { color: #D9D5CC; text-decoration: none; border-bottom: 1px solid #45423C; transition: border-color .25s var(--ease); }
.footer__addr a:hover { border-color: #9FB3A4; }
.footer__title {
  font-size: .6875rem; letter-spacing: .18em; text-transform: uppercase;
  color: #8C877D; margin-bottom: 1.1rem; font-weight: 500;
}
.footer__list { list-style: none; }
.footer__list li + li { margin-top: .7rem; }
.footer__list a { color: #D9D5CC; text-decoration: none; transition: color .25s var(--ease); }
.footer__list a:hover { color: #fff; }
.footer__bottom {
  border-top: 1px solid #2E2C28; padding-top: 1.75rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem;
  font-size: .75rem; color: #8C877D;
}
.footer__disclaimer {
  margin-top: 1.75rem; font-size: .75rem; line-height: 1.75; color: #8F8A80; max-width: 70ch;
}
.site-footer :focus-visible { outline-color: #9FB3A4; }

/* ---------- legal / text pages ---------- */
.page-head {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2rem, 4vw, 3rem);
  background: linear-gradient(180deg, #F7F4ED 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line-soft);
}
.page-head .display { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
.page-head__meta { margin-top: 1.25rem; font-size: .75rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }

.prose { padding-block: clamp(3rem, 6vw, 4.5rem) clamp(4rem, 8vw, 6rem); }
.prose h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.25;
  letter-spacing: -0.012em; margin: 3rem 0 1rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--serif); font-weight: 400; font-size: 1.1875rem; margin: 2rem 0 .75rem; }
.prose p { color: var(--ink-soft); margin-bottom: 1.15rem; }
.prose ul { list-style: none; margin: 0 0 1.5rem; }
.prose ul li {
  position: relative; padding-left: 1.4rem; color: var(--ink-soft); margin-bottom: .65rem;
}
.prose ul li::before {
  content: ''; position: absolute; left: 0; top: .78em;
  width: 6px; height: 1px; background: var(--accent-mid);
}
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ink); }
.prose__intro { font-size: 1.0625rem; color: var(--ink-soft); line-height: 1.72; margin-bottom: 2.5rem; }
.callout {
  background: var(--bg-alt); border-left: 2px solid var(--accent-mid);
  padding: 1.5rem 1.75rem; border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: 2rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.toc {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 1.5rem 1.75rem; margin-bottom: 3rem;
}
.toc__title { font-size: .6875rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; font-weight: 500; }
.toc ol { list-style: none; counter-reset: toc; columns: 2; column-gap: 2rem; }
@media (max-width: 620px) { .toc ol { columns: 1; } }
.toc li { counter-increment: toc; margin-bottom: .5rem; font-size: .875rem; break-inside: avoid; }
.toc li::before { content: counter(toc) '.'; color: var(--muted); margin-right: .5rem; font-variant-numeric: tabular-nums; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); }

/* ---------- 404 ---------- */
.error-page {
  min-height: 62vh; display: flex; align-items: center;
  padding-block: clamp(4rem, 10vw, 7rem);
}
.error-page__inner { text-align: center; max-width: 520px; margin-inline: auto; }
.error-page .lede { margin-inline: auto; margin-block: 1.25rem 2.25rem; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-visible { opacity: 1; transform: none; transition: none; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .hero__art, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- hero cover fan ---------- */
.cover-fan {
  position: relative; width: 100%; max-width: 560px; margin-inline: auto;
  aspect-ratio: 1.32 / 1;
}
.cover-fan img {
  position: absolute; width: 52%; border-radius: var(--r-md);
  border: 1px solid rgba(226,221,210,.9);
  box-shadow: 0 26px 52px -26px rgba(25,24,21,.38), 0 2px 6px rgba(25,24,21,.06);
  background: var(--bg-deep);
}
.cover-fan__a { left: 0;   top: 9%;  transform: rotate(-6.5deg); z-index: 1; }
.cover-fan__b { left: 23%; top: 0;   width: 56%;                 z-index: 3; }
.cover-fan__c { right: 0;  top: 11%; transform: rotate(6.5deg);  z-index: 2; }
@media (max-width: 480px) {
  .cover-fan { max-width: 340px; }
}
