/* ============================================================
   Grogile — main.css
   Design tokens, reset, base type, buttons, shared primitives.
   Direction: warm editorial B2B (cream canvas, terracotta ink).
   ============================================================ */

@import "layout.css";
@import "components.css";

:root {
  /* ---- Brand palette (from styleguide) ---- */
  --c-primary: #d25b31;        /* terracotta */
  --c-primary-deep: #b4441f;
  --c-primary-soft: #e8855f;
  --c-bg: #f0e9e1;             /* warm cream */
  --c-bg-deep: #e7ddd0;
  --c-tertiary: #8c7f77;       /* warm gray */
  --c-ink: #1a1817;            /* near black */
  --c-ink-soft: #3a3431;
  --c-mint: #c7e6ce;           /* highlight */
  --c-mint-deep: #a7d4b1;

  /* ---- Surfaces ---- */
  --surface-base: #f0e9e1;
  --surface-raised: #f7f2ec;
  --surface-card: #fbf8f4;
  --surface-line: rgba(26, 24, 23, 0.1);
  --surface-line-strong: rgba(26, 24, 23, 0.16);

  /* ---- Text ---- */
  --text-strong: var(--c-ink);
  --text-body: #4a433f;
  --text-muted: #756c66;
  --text-on-dark: #f0e9e1;
  --text-on-dark-muted: rgba(240, 233, 225);

  /* ---- Typography ---- */
  --font-body: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Inter", "Pretendard", -apple-system, system-ui, sans-serif;

  --text-eyebrow: 0.8125rem;
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --text-lede: clamp(1.0625rem, 1rem + 0.4vw, 1.3125rem);
  --text-h3: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --text-h2: clamp(2rem, 1.3rem + 3vw, 3.75rem);
  --text-hero: clamp(2.5rem, 1.2rem + 5.4vw, 5rem);

  /* ---- Spacing rhythm ---- */
  --space-section: clamp(2.75rem, 1.75rem + 4vw, 5.5rem);
  --container-pad: clamp(1.25rem, 0.5rem + 3vw, 3rem);
  --container-max: 1200px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-xl: 36px;

  /* ---- Motion ---- */
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 720ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- Shadows (tinted, layered) ---- */
  --shadow-sm: 0 1px 2px rgba(26, 24, 23, 0.05), 0 4px 12px rgba(178, 68, 31, 0.05);
  --shadow: 0 2px 6px rgba(26, 24, 23, 0.06), 0 18px 40px -16px rgba(178, 68, 31, 0.18);
  --shadow-lg: 0 4px 10px rgba(26, 24, 23, 0.07), 0 36px 70px -24px rgba(178, 68, 31, 0.26);
}

/* ---- Reset ---- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-body);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  word-break: keep-all;       /* Korean: break at spaces, not mid-word */
  overflow-wrap: break-word;
  /* layered warm atmosphere */
  background-image:
    radial-gradient(60% 50% at 88% -5%, rgba(210, 91, 49, 0.1), transparent 60%),
    radial-gradient(50% 45% at -5% 12%, rgba(199, 230, 206, 0.28), transparent 60%);
  background-attachment: fixed;
}

img { 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, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.14; font-weight: 600; }

::selection { background: var(--c-primary); color: var(--c-bg); }

:focus-visible {
  outline: 2.5px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Accessibility helpers ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 50%; top: -64px; transform: translateX(-50%);
  background: var(--c-ink); color: var(--c-bg); padding: 0.6rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 200;
  transition: top var(--dur) var(--ease-out-expo);
}
.skip-link:focus { top: 0; }

/* ============================================================
   Shared primitives — eyebrow, section heads, buttons
   ============================================================ */

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-eyebrow);
  letter-spacing: 0.02em;
  color: var(--c-primary);
  margin-bottom: 1.1rem;
}
.eyebrow--light { color: var(--c-mint); }
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(210, 91, 49, 0.18);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-h2);
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text-strong);
}
.section-title--light { color: var(--text-on-dark); }

.ink-accent { color: var(--c-primary); }
.hl-accent {
  color: var(--c-mint);
  background: linear-gradient(transparent 62%, rgba(199, 230, 206, 0.22) 62%);
}

.section-lede {
  margin-top: 1.35rem;
  font-size: var(--text-lede);
  line-height: 1.65;
  color: var(--text-body);
  max-width: 54ch;
}
.section-lede--light { color: var(--text-on-dark-muted); }

.section-head { max-width: 760px; margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head--center .section-lede { margin-inline: auto; }
.section-head--center .hero-cta { justify-content: center; }
.section-head--center .trust-points { justify-content: center; }
.section-head--row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem; max-width: none; flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
  --btn-bg: var(--c-ink);
  --btn-fg: var(--c-bg);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em;
  background: var(--btn-bg); color: var(--btn-fg);
  border-radius: 999px;
  border: 1.5px solid transparent;
  transition: transform var(--dur-fast) var(--ease-spring),
    box-shadow var(--dur) var(--ease-out-expo),
    background-color var(--dur) var(--ease-out-expo),
    color var(--dur) var(--ease-out-expo);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary { --btn-bg: var(--c-primary); --btn-fg: #fff; }
.btn-primary:hover { --btn-bg: var(--c-primary-deep); box-shadow: 0 14px 30px -10px rgba(210, 91, 49, 0.55); }

.btn-ghost {
  --btn-bg: transparent; --btn-fg: var(--c-ink);
  border-color: var(--surface-line-strong);
}
.btn-ghost:hover { --btn-bg: var(--c-ink); --btn-fg: var(--c-bg); border-color: var(--c-ink); }

.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.25s var(--ease-out-expo),
    transform 1.25s var(--ease-out-expo);
  transition-delay: calc(var(--reveal-delay, 0) * 180ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* Intro: slower, more deliberate staggered reveal */
.intro-reveal [data-reveal] {
  transform: translateY(48px);
  transition-duration: 1.5s;
  transition-delay: calc(var(--reveal-delay, 0) * 320ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
