/* ==========================================================================
   Zain Korea — stylesheet
   Warm editorial system: cream paper, espresso ink, terracotta accent.
   Mobile-first; breakpoints at 640 / 760 / 900 / 1080.
   ========================================================================== */

:root {
  /* Color tokens */
  --bg: #FAF7F2;
  --bg-sand: #F3EDE2;
  --surface: #FFFFFF;
  --fg: #1C1A17;
  --fg-soft: #544B43;
  --muted: #8A817A;
  --border: rgba(28, 26, 23, 0.12);
  --border-strong: rgba(28, 26, 23, 0.26);
  --accent: #C0512F;
  --accent-strong: #A8451F;
  --secondary: #2F5B4F;
  --secondary-tint: rgba(47, 91, 79, 0.09);
  --secondary-line: rgba(47, 91, 79, 0.24);
  --danger: #A33A22;
  --on-dark: #EDE5D8;
  --dark: #231E19;

  /* Type */
  --font-display: 'Cormorant', Georgia, 'Times New Roman', serif;
  --font-body: 'Karla', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --fs-caption: 12px;
  --fs-small: 13.5px;
  --fs-body: 16px;
  --fs-body-lg: 17px;
  --fs-lead: clamp(17px, 1.35vw, 19px);
  --fs-h3: clamp(21px, 1.9vw, 25px);
  --fs-h2: clamp(34px, 4.6vw, 54px);
  --fs-h1: clamp(44px, 6.4vw, 92px);
  --fs-email: clamp(24px, 2.4vw, 32px);

  /* Layout */
  --maxw: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --shadow-hover: 0 2px 16px rgba(28, 26, 23, 0.07);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Base ------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
}
@media (min-width: 720px) {
  body { font-size: var(--fs-body-lg); }
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.55em;
}
h2 { font-size: var(--fs-h2); letter-spacing: -0.018em; line-height: 1.08; }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }

.link-accent { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

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

::selection { background: rgba(192, 81, 47, 0.18); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* Layout helpers --------------------------------------------------------- */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: clamp(72px, 10vw, 128px) 0; }
.section[id] { scroll-margin-top: 84px; }

.eyebrow {
  font-size: var(--fs-caption);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 14px;
}

.lead {
  font-size: var(--fs-lead);
  color: var(--fg-soft);
  max-width: 56ch;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.92em 1.6em;
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FBF6EF;
}
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--primary:active { transform: translateY(1px); }

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--fg);
  background: transparent;
}
.btn--ghost:hover { border-color: rgba(28, 26, 23, 0.55); background: rgba(28, 26, 23, 0.04); }

.btn--quiet {
  background: none;
  border: none;
  padding: 0.75em 0;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(28, 26, 23, 0.38);
}
.btn--quiet:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Header ----------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
}
.wordmark:hover { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 36px; }
.site-nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a:not(.btn) {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg);
}
.site-nav a:not(.btn):hover {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(192, 81, 47, 0.55);
}
.nav-cta { font-size: 14px; padding: 0.62em 1.15em; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1.6px;
  background: var(--fg);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
body.nav-open .nav-toggle-bar:first-child { transform: translateY(3.3px) rotate(45deg); }
body.nav-open .nav-toggle-bar:last-child { transform: translateY(-3.3px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 49;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 24px;
    box-shadow: 0 16px 24px rgba(28, 26, 23, 0.06);
  }
  body.nav-open .site-nav { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--border); }
  .site-nav a:not(.btn) { display: block; padding: 15px 0; font-size: 17px; }
  .nav-cta { align-self: flex-start; margin-top: 18px; }
}

/* Hero ------------------------------------------------------------------- */

.hero { background: var(--bg); }

.hero-grid {
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 640px;
  min-height: clamp(560px, calc(100svh - 73px), 860px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(48px, 6.5vw, 96px) clamp(28px, 5.5vw, 88px);
}

.hero-title {
  font-size: var(--fs-h1);
  letter-spacing: -0.02em;
  line-height: 1.03;
  font-weight: 400;
  margin: 16px 0 24px;
  max-width: 12ch;
}

.hero .lead { margin: 0 0 34px; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.hero-media { position: relative; overflow: hidden; min-height: 320px; min-width: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { padding: clamp(40px, 9vw, 64px) var(--gutter) clamp(36px, 7vw, 48px); }
  .hero-title { max-width: 14ch; }
  .hero-media { height: min(92vw, 540px); }
  .hero-media img { object-position: center 68%; }
}

/* Motion ----------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .js .hero-copy > * {
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.8s var(--ease) forwards;
  }
  .js .hero-copy > *:nth-child(2) { animation-delay: 0.1s; }
  .js .hero-copy > *:nth-child(3) { animation-delay: 0.2s; }
  .js .hero-copy > *:nth-child(4) { animation-delay: 0.3s; }
}

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

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .hero-copy > * { animation: none; opacity: 1; transform: none; }
}

/* Split sections (About / Contact) --------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.split-media { margin: 0; min-width: 0; }
.split-copy { min-width: 0; }
.split-media img { border-radius: var(--radius-l); width: 100%; }

.split-copy > p { color: var(--fg-soft); max-width: 60ch; }

.facts { margin: 30px 0 0; border-top: 1px solid var(--border); }
.fact {
  display: flex;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.fact dt {
  flex: none;
  width: 130px;
  font-size: var(--fs-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  padding-top: 3px;
}
.fact dd { margin: 0; color: var(--fg); }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-media { max-width: 560px; }
}

/* Products --------------------------------------------------------------- */

.products { background: var(--bg-sand); }

.section-head { max-width: 640px; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head .lead { margin-top: 4px; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px);
}

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.card-media { margin: 0; }
.card-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.card-body { padding: clamp(20px, 2.4vw, 28px); }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.card h3 { margin: 0; font-weight: 500; }

.tag {
  flex: none;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--secondary);
  background: var(--secondary-tint);
  border: 1px solid var(--secondary-line);
  padding: 5px 10px;
  border-radius: var(--radius-s);
}

.card-body p { margin: 0; color: var(--fg-soft); font-size: 15.5px; }

.fineprint {
  font-size: var(--fs-small);
  color: var(--muted);
  margin-top: clamp(20px, 3vw, 32px);
}
.fineprint a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fineprint a:hover { color: var(--accent-strong); }

@media (max-width: 760px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
}

/* Contact ---------------------------------------------------------------- */

.split--contact { align-items: start; }

.email-line {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 24px 0 4px;
}
.email {
  font-family: var(--font-display);
  font-size: var(--fs-email);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(192, 81, 47, 0.4);
}
.email:hover { color: var(--accent-strong); text-decoration-color: var(--accent-strong); }

.copy-btn {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-soft);
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.copy-btn:hover { border-color: var(--fg); color: var(--fg); }

.copy-status {
  min-height: 1.3em;
  font-size: var(--fs-small);
  color: var(--secondary);
  margin: 8px 0 0;
}

/* Form ------------------------------------------------------------------- */

.contact-form { display: block; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }

.field label {
  font-size: var(--fs-caption);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-soft);
}
.field .req { color: var(--accent); }
.field .opt {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--fg);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 9px 2px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field input:focus-visible { box-shadow: 0 1px 0 0 var(--accent); }

.field textarea {
  resize: vertical;
  min-height: 130px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.55;
}
.field textarea:focus-visible {
  box-shadow: 0 0 0 2px rgba(192, 81, 47, 0.28);
  border-color: var(--accent);
}

.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 640px) {
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

.field-error {
  color: var(--danger);
  font-size: var(--fs-small);
  margin: 2px 0 0;
}

.field.is-invalid input,
.field.is-invalid textarea { border-color: var(--danger); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.form-status {
  min-height: 1.4em;
  font-size: 14.5px;
  color: var(--secondary);
  margin: 0;
  max-width: 46ch;
}
.form-status.is-error { color: var(--danger); }

/* Footer ----------------------------------------------------------------- */

.site-footer {
  background: var(--dark);
  color: var(--on-dark);
  padding: clamp(48px, 7vw, 76px) 0 28px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 36px;
  align-items: start;
  padding-bottom: 40px;
}

.wordmark--footer {
  font-size: 27px;
  color: #F6EFE3;
  margin: 0 0 10px;
}
.footer-tagline { color: rgba(237, 229, 216, 0.72); font-size: 15px; margin: 0; }

.footer-nav ul {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.footer-nav a { color: rgba(237, 229, 216, 0.85); font-size: 15px; }
.footer-nav a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 5px; }

.footer-contact a { color: rgba(237, 229, 216, 0.85); font-size: 15px; }
.footer-contact a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 5px; }

.footer-bottom {
  border-top: 1px solid rgba(237, 229, 216, 0.14);
  padding-top: 22px;
}
.footer-bottom p { margin: 0; font-size: var(--fs-small); color: rgba(237, 229, 216, 0.6); }

.site-footer :focus-visible { outline-color: #E8B79F; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}
