/* ───────────────────────────────────────────────────────
   Harabi AI — minimal editorial design system
   ─────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* Palette: near-monochrome + single accent */
  --ink:        #0a0d12;
  --ink-2:      #1a1f29;
  --text:       #1d232e;
  --text-2:     #4a5260;
  --muted:      #6b7383;
  --line:       #ececef;
  --line-2:     #d9dade;
  --bg:         #ffffff;
  --bg-2:       #fafafa;
  --accent:     #0a0d12;
  --accent-soft:#f1f1f2;

  /* Type */
  --font-sans:  "Pretendard Variable", Pretendard, ui-sans-serif, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Helvetica Neue", "Noto Sans KR", sans-serif;
  --font-mono:  ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  /* Scale */
  --container:  1120px;
  --radius:     10px;
  --radius-lg:  14px;

  /* Motion */
  --ease:       cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast:     160ms;
  --t-base:     240ms;
  --t-slow:     480ms;

  font-family: var(--font-sans);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv01";
}

/* Korean-aware wrapping: break at 어절, never mid-syllable. */
h1, h2, h3, h4, h5, p, li, label, span, button, a, .eyebrow {
  word-break: keep-all;
  overflow-wrap: break-word;
}

body.nav-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--ink); color: #fff; }

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
}
.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

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

/* ── Type primitives ─────────────────────────────────── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #1a8754;
  box-shadow: 0 0 0 4px rgba(26, 135, 84, 0.12);
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.018em;
}

/* ── Header / Nav ────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  transition: border-color var(--t-base) var(--ease), background var(--t-base) var(--ease);
}

.site-header.is-scrolled {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.nav-shell {
  width: min(var(--container), calc(100% - 40px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.brand-mark img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.brand-text { font-size: 15.5px; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}

.nav-menu a { transition: color var(--t-fast) var(--ease); }
.nav-menu a:hover, .nav-menu a:focus { color: var(--ink); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.nav-cta:hover { background: var(--ink-2); transform: translateY(-1px); }
.nav-cta svg { transition: transform var(--t-fast) var(--ease); }
.nav-cta:hover svg { transform: translateX(2px); }

.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span:not(.sr-only) {
  display: block;
  width: 14px; height: 1.6px;
  background: var(--ink);
  border-radius: 99px;
}

/* ── Buttons / links ─────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.button svg { transition: transform var(--t-fast) var(--ease); }
.button:hover svg { transform: translateX(2px); }

.button.primary { background: var(--ink); color: #fff; }
.button.primary:hover { background: var(--ink-2); transform: translateY(-1px); }

.button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.button.secondary:hover { border-color: var(--ink); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  height: 46px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  transition: color var(--t-fast) var(--ease);
}
.link-arrow svg { transition: transform var(--t-fast) var(--ease); }
.link-arrow:hover { color: var(--ink); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ── Hero ────────────────────────────────────────────── */

.hero {
  position: relative;
  padding: clamp(96px, 14vw, 168px) 0 clamp(72px, 10vw, 120px);
  overflow: hidden;
  background: var(--bg);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 100%;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  max-width: 880px;
}

.hero h1 {
  margin: 22px 0 0;
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 750;
}

.hero-copy {
  max-width: 600px;
  margin: 26px 0 0;
  color: var(--text-2);
  font-size: clamp(16px, 1.4vw, 18.5px);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 40px 0 0;
}

/* ── Sections (shared) ───────────────────────────────── */

.section {
  padding: clamp(80px, 11vw, 140px) 0;
  border-top: 1px solid var(--line);
}

.section-inner {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}

.section-heading {
  max-width: 720px;
  margin: 0 0 clamp(48px, 7vw, 80px);
}

.section-heading h2 {
  margin: 20px 0 0;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.14;
  letter-spacing: -0.022em;
  font-weight: 720;
}

.section-heading p:not(.eyebrow) {
  margin: 18px 0 0;
  color: var(--text-2);
  font-size: clamp(15.5px, 1.2vw, 17px);
  line-height: 1.75;
  max-width: 580px;
}

/* ── Grid ────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 12px;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Card — solid white, hairline border, restrained hover */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 28px 26px 30px;
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -8px rgba(10, 13, 18, 0.08);
}

.card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.card p {
  margin: 12px 0 0;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.7;
}

/* Hairline rule grid — Use for Quality. Pure CSS table-like dividers */
.grid-rule {
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}

.rule-card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 32px 28px;
  transition: background var(--t-fast) var(--ease);
}
.rule-card:hover { background: var(--bg-2); }

.rule-card h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.012em;
}
.rule-card p {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ── Services / Use cases sections (background) ─────── */

.services, .use-cases { background: var(--bg); }
.quality { background: var(--bg-2); }

/* ── Approach ────────────────────────────────────────── */

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

.approach-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(48px, 8vw, 96px);
  align-items: start;
}

.approach-layout .section-heading {
  margin-bottom: 0;
  position: sticky;
  top: 92px;
}

.process {
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-step {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 24px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.process-step:last-child { border-bottom: 1px solid var(--line); }

.step-num {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.step-body h3 {
  margin: 4px 0 0;
  font-size: 18.5px;
  font-weight: 650;
  letter-spacing: -0.012em;
}
.step-body p {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.72;
}

/* ── Contact ─────────────────────────────────────────── */

.contact-section {
  padding: clamp(96px, 12vw, 144px) 0 clamp(96px, 12vw, 144px);
  background: #0a0d12;
  color: #f4f5f7;
  border-top: 1px solid var(--line);
}

.contact-inner {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(48px, 7vw, 88px);
  align-items: start;
}

.contact-copy .eyebrow { color: #8a93a3; }
.contact-copy h2 {
  margin: 18px 0 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.024em;
  font-weight: 720;
}
.contact-copy p:not(.eyebrow) {
  margin: 20px 0 0;
  color: #b9c0cd;
  font-size: clamp(15.5px, 1.2vw, 17px);
  line-height: 1.75;
  max-width: 460px;
}

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding-bottom: 4px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.22);
  transition: border-color var(--t-fast) var(--ease);
}
.contact-mail:hover { border-color: #fff; }
.contact-mail svg { transition: transform var(--t-fast) var(--ease); }
.contact-mail:hover svg { transform: translateX(3px); }

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-form label {
  display: grid;
  gap: 8px;
}

.contact-form span {
  color: #b1b9c7;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 14.5px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23b1b9c7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.contact-form textarea {
  height: auto;
  min-height: 132px;
  padding: 12px 14px;
  line-height: 1.6;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #6b7383; }

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.wide, .wide-button { grid-column: 1 / -1; }

.wide-button {
  background: #fff;
  color: var(--ink);
  height: 48px;
  border-radius: 999px;
  justify-self: start;
  min-width: 160px;
  margin-top: 6px;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.wide-button:hover { background: #e9eaee; transform: translateY(-1px); }
.wide-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.form-status {
  min-height: 22px;
  margin: 2px 0 0;
  color: #cfd6e3;
  font-size: 13.5px;
  line-height: 1.55;
}

.form-status.is-success { color: #90f0c2; }
.form-status.is-error { color: #ffb8b8; }

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
  background: #060810;
  color: #7a8294;
  padding: 32px 0;
}

.footer-inner {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #e6e8ee;
  font-size: 14px;
  font-weight: 600;
}
.footer-brand .brand-mark {
  width: 24px; height: 24px;
  background: rgba(255,255,255,0.08);
  color: #e6e8ee;
}

.footer-brand .brand-mark img {
  width: 18px;
  height: 18px;
  filter: invert(1);
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 13.5px;
}
.footer-inner nav a {
  color: #9aa3b3;
  transition: color var(--t-fast) var(--ease);
}
.footer-inner nav a:hover { color: #fff; }

.footer-meta {
  margin: 0;
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ── Reveal animations ───────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .approach-layout, .contact-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .approach-layout .section-heading { position: static; }
}

@media (max-width: 720px) {
  .nav-shell {
    height: 58px;
    width: min(var(--container), calc(100% - 28px));
  }
  .nav-toggle { display: inline-flex; }

  .nav-menu {
    position: fixed;
    left: 14px; right: 14px;
    top: 64px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 14px 36px rgba(0,0,0,0.06);
    padding: 8px;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu a {
    padding: 13px 12px;
    border-radius: 8px;
  }
  .nav-menu a:hover { background: var(--bg-2); }
  .nav-cta { display: none; }

  .hero { padding: 80px 0 56px; }
  .hero h1 { font-size: clamp(32px, 8vw, 44px); }
  .hero-copy { font-size: 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .hero-actions .button { width: 100%; }
  .link-arrow { justify-content: center; height: 44px; }
  .hero-meta {
    margin-top: 56px;
    font-size: 11.5px;
    gap: 10px;
  }

  .section { padding: 72px 0; }
  .section-inner, .footer-inner, .contact-inner {
    width: min(var(--container), calc(100% - 28px));
  }
  .section-heading { margin-bottom: 36px; }
  .section-heading h2 br { display: none; }

  .grid-3 { grid-template-columns: 1fr; }

  .card, .rule-card { padding: 24px 22px; }
  .card h3 { font-size: 16.5px; }
  .card-num { margin-bottom: 18px; }

  .grid-rule { border-radius: var(--radius); }
  .rule-card {
    border-right: 0;
    border-left: 0;
    border-top: 0;
  }
  .grid-rule { border-left: 0; border-top: 0; }
  .rule-card:first-child { border-top: 1px solid var(--line); }

  .process-step {
    grid-template-columns: 40px 1fr;
    column-gap: 16px;
    padding: 22px 0;
  }
  .step-num { width: 32px; height: 32px; font-size: 11.5px; }
  .step-body h3 { font-size: 17px; }

  .contact-section { padding: 72px 0; }
  .contact-copy h2 { font-size: clamp(28px, 7vw, 36px); }
  .contact-copy h2 br { display: none; }
  .contact-form {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 32px; line-height: 1.15; }
  .section-heading h2 { font-size: 26px; }
}

/* Subtle scrollbar refinement (WebKit) */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: #d8d9de; border-radius: 10px; border: 2px solid #fff; }
  ::-webkit-scrollbar-thumb:hover { background: #bdbec5; }
  ::-webkit-scrollbar-track { background: transparent; }
}
