/* =========================================================
   Pinuslab — shared stylesheet
   Design tokens + base + utilities + components
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;1,6..72,300;1,6..72,400&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.css');

:root {
  /* Palette — Les Landes de Gascogne */
  --pine-950: #0A1712;
  --pine-900: #0F1F18;
  --pine-800: #17301F;
  --pine-700: #1F3A2E;
  --pine-600: #2F4F40;
  --pine-500: #4A6556;
  --pine-400: #6B8E7F;
  --pine-300: #9BB3A7;
  --pine-200: #C5D2CB;

  --mist-50:  #FBF9F3;
  --mist-100: #F6F3EC;
  --mist-200: #EDE8DB;
  --mist-300: #E3DED3;
  --mist-400: #C8C1B0;

  --sand-600: #A8824C;
  --sand-500: #C9A77A;
  --sand-400: #D4B58A;
  --sand-300: #E3CBA8;

  --gold: #B8902C;

  --text: var(--pine-900);
  --text-muted: #4A5A52;
  --text-subtle: #7A8981;
  --text-inverse: #F3EFE6;

  --bg: var(--mist-100);
  --bg-alt: #FFFFFF;
  --bg-dark: var(--pine-900);
  --bg-darker: var(--pine-950);

  --border: #DED8C9;
  --border-dark: rgba(243, 239, 230, 0.14);

  /* Type */
  --serif: "Newsreader", "Times New Roman", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Density — editorial (default) */
  --d-sec-y: 160px;
  --d-sec-y-mob: 88px;
  --d-gap: 32px;
  --d-card-pad: 32px;
  --d-body-size: 17px;
  --d-lead-size: 20px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --max-w: 1280px;
  --page-pad: 40px;
}

[data-density="compact"] {
  --d-sec-y: 96px;
  --d-sec-y-mob: 64px;
  --d-gap: 20px;
  --d-card-pad: 22px;
  --d-body-size: 15px;
  --d-lead-size: 17px;
}

/* Theme: light (default) keeps palette above.
   Dark theme inverts surfaces. */
[data-theme="dark"] {
  --text: var(--mist-100);
  --text-muted: #A8B5AE;
  --text-subtle: #7A8981;
  --text-inverse: var(--pine-900);
  --bg: var(--pine-900);
  --bg-alt: var(--pine-800);
  --bg-dark: var(--pine-950);
  --bg-darker: #050B08;
  --border: rgba(243, 239, 230, 0.12);
  --border-dark: rgba(243, 239, 230, 0.2);
}

@media (max-width: 767px) {
  :root { --page-pad: 20px; }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: var(--d-body-size);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
h1,h2,h3,h4 { margin: 0; font-weight: 500; letter-spacing: -0.01em; word-break: keep-all; line-break: strict; overflow-wrap: break-word; }
p { margin: 0; text-wrap: pretty; word-break: keep-all; line-break: strict; overflow-wrap: break-word; }
/* Korean: prevent mid-word line breaks; let CSS handle wrapping inside meaning units */
:lang(ko) { word-break: keep-all; line-break: strict; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* =========================
   Layout
   ========================= */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--page-pad); }
.section { padding: var(--d-sec-y) 0; }
.section-dark { background: var(--bg-dark); color: var(--text-inverse); }
.section-dark .muted { color: #9BB3A7; }
.section-ivory { background: var(--mist-50); }

@media (max-width: 767px) {
  .section { padding: var(--d-sec-y-mob) 0; }
}

/* =========================
   Type utilities
   ========================= */
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(44px, 7.2vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.display em { font-style: italic; font-weight: 300; }

.h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.h3 {
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.lead {
  font-size: var(--d-lead-size);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 56ch;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sand-500);
  margin-right: 10px;
  vertical-align: middle;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.serif { font-family: var(--serif); }

/* =========================
   Header / nav
   ========================= */
.nav {
  position: fixed; inset: 0 0 auto 0;
  height: 72px;
  z-index: 100;
  display: flex; align-items: center;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), height .3s var(--ease);
}
.nav[data-scrolled="true"] {
  height: 60px;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom-color: var(--border);
}
.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.logo {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 400;
  display: flex; align-items: center; gap: 10px;
}
.logo .mark {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-links {
  display: flex; align-items: center; gap: 36px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a {
  position: relative;
  padding: 6px 0;
  color: var(--text);
  transition: color .2s var(--ease);
}
.nav-links a:hover { color: var(--sand-600); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--sand-500);
}
.nav-right { display: flex; align-items: center; gap: 18px; }
.lang-toggle {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}
.nav-cta {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--pine-900);
  color: var(--mist-100);
  transition: background .2s var(--ease);
  white-space: nowrap;
}
.nav-links { white-space: nowrap; }
[data-theme="dark"] .nav-cta { background: var(--sand-500); color: var(--pine-950); }
.nav-cta:hover { background: var(--pine-700); }
[data-theme="dark"] .nav-cta:hover { background: var(--sand-400); }

.hamburger { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; }
.hamburger span {
  width: 18px; height: 1px; background: currentColor;
  position: relative;
}
.hamburger span::before, .hamburger span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 1px; background: currentColor;
}
.hamburger span::before { top: -6px; }
.hamburger span::after  { top:  6px; }

@media (max-width: 1100px) {
  .nav-links, .nav-right .lang-toggle, .nav-right .nav-cta { display: none; }
  .hamburger { display: inline-flex; }
}

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 200;
  padding: 72px var(--page-pad) 40px;
  transform: translateX(100%);
  transition: transform .4s var(--ease);
  display: flex; flex-direction: column; gap: 24px;
}
.drawer.open { transform: translateX(0); }
.drawer .close {
  position: absolute; top: 18px; right: var(--page-pad);
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.drawer a {
  font-family: var(--serif);
  font-size: 28px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

/* =========================
   Buttons
   ========================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  font-size: 14px; font-weight: 500;
  border-radius: 999px;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  letter-spacing: 0.01em;
}
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.btn-primary { background: var(--pine-900); color: var(--mist-100); }
.btn-primary:hover { background: var(--pine-700); }

.btn-ghost { border: 1px solid var(--border-dark); color: inherit; }
.section-dark .btn-ghost { border-color: rgba(243,239,230,0.25); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); }
.section-dark .btn-ghost:hover { background: rgba(243,239,230,0.06); }

.btn-sand { background: var(--sand-500); color: var(--pine-950); }
.btn-sand:hover { background: var(--sand-400); }

.btn-link {
  padding: 0; border-radius: 0;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.02em;
}

/* =========================
   Cards / chips / rule
   ========================= */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.section-dark .chip { background: transparent; border-color: var(--border-dark); color: var(--pine-300); }

.rule { height: 1px; background: var(--border); width: 100%; }
.section-dark .rule { background: var(--border-dark); }

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--d-card-pad);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
[data-theme="dark"] .card { background: var(--pine-800); border-color: var(--border-dark); }

/* =========================
   Footer
   ========================= */
.footer {
  background: var(--bg-darker);
  color: #C5D2CB;
  padding: 96px 0 40px;
  border-top: 1px solid rgba(243,239,230,0.08);
}
.footer .grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(243,239,230,0.1);
}
.footer h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9BB3A7;
  margin-bottom: 20px;
  font-weight: 500;
}
.footer a { display: block; padding: 6px 0; font-size: 14px; color: var(--mist-100); opacity: 0.78; }
.footer a:hover { opacity: 1; color: var(--sand-400); }
.footer .brand-line {
  font-family: var(--serif); font-size: 28px; color: var(--mist-100);
  margin-bottom: 12px;
}
.footer .tagline { color: #9BB3A7; font-size: 14px; max-width: 28ch; margin-bottom: 28px; }
.footer .cert-row {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px;
}
.footer .cert-row .chip { background: transparent; border-color: rgba(243,239,230,0.18); color: #C5D2CB; }
.footer .fine {
  display: grid; gap: 14px;
  padding: 28px 0;
  font-size: 12px; color: #9BB3A7; line-height: 1.7;
  border-bottom: 1px solid rgba(243,239,230,0.1);
}
.footer .meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.1em;
  color: #7A8981;
  text-transform: uppercase;
}
@media (max-width: 900px) {
  .footer .grid { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
}

/* =========================
   Compliance notice
   ========================= */
.notice {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 16px 18px;
  border-left: 2px solid var(--sand-500);
  background: color-mix(in oklab, var(--sand-500) 6%, transparent);
}
.section-dark .notice { background: rgba(201,167,122,0.06); color: var(--pine-200); }

/* =========================
   Reveal on scroll
   ========================= */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================
   Image placeholder (stripe)
   ========================= */
.img-ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(15,31,24,0.05) 0 2px, transparent 2px 12px),
    var(--mist-200);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.08em;
}
.img-ph img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.img-ph .tag { position: absolute; bottom: 10px; left: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--mist-100); text-transform: uppercase; }

/* Duotone treatment for photos (pine + ivory) */
.duotone {
  position: relative;
}
.duotone img {
  filter: grayscale(1) contrast(1.05) brightness(0.92);
  mix-blend-mode: luminosity;
}
.duotone::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(15, 31, 24, 0.55) 0%,
    rgba(15, 31, 24, 0.35) 100%);
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--sand-500);
  outline-offset: 3px;
  border-radius: 2px;
}
