/* ============================================================
   KIN — SHARED STYLESHEET
   Shared by index.html, features.html, mission.html, and all
   other Kin pages. Page-specific styles live in each file's
   own <style> block.
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --color-espresso:   #271408;
  --color-coffee:     #4A3F2F;
  --color-amber:      #8B6A3E;
  --color-linen:      #EDE0D4;
  --color-sand:       #E6D5C3;
  --color-tan:        #D5C4A1;
  --color-taupe:      #C9B99A;
  --color-stone:      #9A8A72;
  --color-mist:       #F5EFE8;
  --color-page:       #FDFAF6;

  --bg-page:          var(--color-page);
  --bg-dark:          var(--color-espresso);
  --bg-tint:          var(--color-linen);
  --bg-card:          #FFFFFF;

  --text-primary:     var(--color-espresso);
  --text-body:        var(--color-coffee);
  --text-muted:       var(--color-stone);
  --text-subtle:      var(--color-taupe);
  --text-accent:      var(--color-amber);
  --text-inverse:     var(--color-page);

  --border-default:   var(--color-sand);
  --border-strong:    var(--color-taupe);
  --border-dark:      #3D3020;

  --font-sans:        'DM Sans', sans-serif;
  --font-serif:       'DM Serif Display', serif;

  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  15px;
  --text-md:    17px;
  --text-lg:    22px;
  --text-xl:    28px;
  --text-2xl:   36px;
  --text-3xl:   48px;
  --text-4xl:   64px;

  --space-1:    4px;
  --space-2:    8px;
  --space-3:    12px;
  --space-4:    16px;
  --space-5:    20px;
  --space-6:    24px;
  --space-8:    32px;
  --space-10:   40px;
  --space-12:   48px;
  --space-16:   64px;
  --space-20:   80px;
  --space-24:   96px;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-pill: 999px;

  --shadow-sm:  0 1px 3px rgba(44,36,22,0.06), 0 1px 2px rgba(44,36,22,0.04);
  --shadow-md:  0 4px 12px rgba(44,36,22,0.08), 0 2px 4px rgba(44,36,22,0.04);
  --shadow-lg:  0 12px 32px rgba(44,36,22,0.10), 0 4px 8px rgba(44,36,22,0.06);

  --max-width:        1120px;
  --content-width:    720px;
  --section-padding:  var(--space-20) var(--space-5);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-sans); cursor: pointer; border: none; background: none; }

/* ============================================================
   GRAIN TEXTURE OVERLAY
   ============================================================ */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  z-index: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container--narrow {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.label--accent {
  color: var(--text-accent);
  background: rgba(139,106,62,0.10);
  border: 0.5px solid rgba(139,106,62,0.25);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.display { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; }

.heading-xl  { font-size: var(--text-4xl); font-weight: 400; letter-spacing: -0.03em; line-height: 1.05; }
.heading-lg  { font-size: var(--text-3xl); font-weight: 400; letter-spacing: -0.025em; line-height: 1.1; }
.heading-md  { font-size: var(--text-2xl); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }

.body-lg  { font-size: var(--text-md); line-height: 1.65; color: var(--text-body); }
.body-md  { font-size: var(--text-base); line-height: 1.65; color: var(--text-body); }
.body-sm  { font-size: var(--text-sm); line-height: 1.6; color: var(--text-body); }

em { font-style: italic; color: var(--text-accent); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn { text-decoration: none; }
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--bg-dark); color: var(--text-inverse); }
.btn--secondary { background: transparent; color: var(--text-primary); border: 0.5px solid var(--border-strong); transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.btn--secondary.btn--ready { background: var(--bg-dark); color: var(--text-inverse); border-color: var(--bg-dark); }
.btn--ghost-dark { background: transparent; color: var(--color-tan); border: 0.5px solid var(--border-dark); }
.btn--filled-tan { background: var(--color-tan); color: var(--color-espresso); }
.btn--full { width: 100%; }
.btn--sm { padding: 8px 16px; font-size: var(--text-sm); }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.card--tint { background: var(--bg-tint); border-color: var(--border-strong); }

/* ============================================================
   CHIP
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: rgba(255,255,255,0.7);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 5px 13px;
  font-size: var(--text-xs);
  color: var(--text-body);
  font-weight: 500;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.chip-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider { border: none; border-top: 0.5px solid var(--border-default); }
.divider--dark { border-color: var(--border-dark); }

/* ============================================================
   SECTION
   ============================================================ */
.section {
  padding: var(--section-padding);
  border-top: 0.5px solid var(--border-default);
  position: relative;
}

.section--dark {
  background: var(--bg-dark);
  border-color: transparent;
  overflow: hidden;
}

.section--tint {
  background: var(--bg-tint);
  border-color: transparent;
}

.section-header { margin-bottom: var(--space-10); }
.section-header .label { margin-bottom: var(--space-2); display: block; }

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up-delay-1 { transition-delay: 0.08s; }
.fade-up-delay-2 { transition-delay: 0.16s; }
.fade-up-delay-3 { transition-delay: 0.24s; }
.fade-up-delay-4 { transition-delay: 0.32s; }

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

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(253,250,246,0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(39,20,8,0.06);
  transition: background 0.2s, transform 0.3s ease, opacity 0.3s ease;
}
.nav--hidden {
  transform: translateY(-100px);
}

.nav--hidden-mobile {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

main {
  padding-top: 58px;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px var(--space-5);
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav__logo-wrap { display: flex; flex-direction: column; gap: 1px; line-height: 1; }

.nav__logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.nav__links { display: flex; align-items: center; gap: var(--space-8); list-style: none; }
.nav__links a { font-size: var(--text-sm); color: var(--text-body); transition: color 0.15s; }
.nav__links a:hover { color: var(--text-primary); }
.nav__links a.active { color: var(--text-primary); font-weight: 500; }

/* Hamburger button — hidden on desktop */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 4px;
  width: 36px;
  height: 36px;
}
.nav__hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-espresso);
  border-radius: 2px;
  transition: transform 0.24s ease, opacity 0.24s ease;
  transform-origin: center;
}
.nav__hamburger-bar + .nav__hamburger-bar { margin-top: 5px; }
.nav--open .nav__hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__hamburger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav--open .nav__hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav__mobile-menu {
  display: none;
  position: fixed;
  top: 80px;
  left: 16px;
  right: 16px;
  background: rgba(253,250,246,0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  z-index: 998;
  box-shadow: 0 8px 40px rgba(39,20,8,0.1);
  overflow: hidden;
}
@keyframes menuSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav__mobile-menu.nav__mobile-menu--open {
  display: block;
  animation: menuSlideIn 0.22s ease forwards;
}

/* Featured product strip */
.nav__menu-feature {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 0.5px solid rgba(39,20,8,0.10);
}
.nav__menu-feature-img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}
.nav__menu-feature-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-espresso);
  margin-bottom: 2px;
}
.nav__menu-feature-tag {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.nav__menu-feature-cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-amber);
  text-decoration: none;
}

/* Nav links in mobile drawer */
.nav__mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__mobile-menu ul li a {
  display: block;
  padding: 20px 24px;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-espresso);
  border-bottom: 0.5px solid rgba(39,20,8,0.08);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1;
}
.nav__mobile-menu ul li:last-child a { border-bottom: none; }
.nav__mobile-cta { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 0.5px solid var(--border-default);
}

.footer {
  padding: var(--space-6) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer__logo-wrap { display: flex; flex-direction: column; gap: 2px; }
.footer__logo-img {
  height: 22px;
  width: auto;
  display: block;
  opacity: 0.85;
}

.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-5); list-style: none; }
.footer__links a { font-size: var(--text-sm); color: var(--text-subtle); transition: color 0.15s; }
.footer__links a:hover { color: var(--text-body); }

.footer__copy { font-size: var(--text-xs); color: var(--text-subtle); }

/* ============================================================
   NAV — FLOATING PILL (desktop)
   Matches index.html design: centered floating pill above page
   ============================================================ */
@media (min-width: 769px) {
  .nav {
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 720px;
    border-radius: 40px;
    border-bottom: none;
    background: rgba(253,250,246,0.72) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 2px 24px rgba(39,20,8,0.07) !important;
  }
  .nav__inner { padding: 12px 28px; }
  .nav__hamburger { display: none !important; }
  .nav__links { display: flex !important; }
  .nav__links a { color: var(--text-body) !important; }
  .nav__links a:hover { color: var(--text-primary) !important; }

  /* Floating nav overlays page — pages handle their own top clearance */
  main { padding-top: 0; }
}

/* ============================================================
   NAV — FLOATING PILL (mobile)
   ============================================================ */
@media (max-width: 768px) {
  .nav {
    top: 12px !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    border-radius: 40px !important;
    border-bottom: none !important;
    background: rgba(253,250,246,0.72) !important;
    box-shadow: 0 2px 20px rgba(39,20,8,0.08) !important;
  }
  .nav__inner { padding: 10px 16px !important; }
  .nav__logo-img { filter: none !important; }
}

/* ============================================================
   RESPONSIVE — shared
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --text-4xl: 40px;
    --text-3xl: 32px;
    --text-2xl: 28px;
    --section-padding: var(--space-12) var(--space-5);
  }

  .nav__links { display: none; }
  .nav__hamburger { display: block; }
  .nav__cta-desktop { display: none; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 540px) {
  :root {
    --text-4xl: 34px;
    --text-3xl: 26px;
    --section-padding: var(--space-10) var(--space-4);
  }
}
