/* Grapipe — brand site (light)
   Palette from brand assets: White, Lavender Mist #F4F0FA, Deep Grape #1F1631, Grape Purple #7A4FC6.
   Muted inks below are Deep Grape mixed toward white. */

:root {
  --paper: #FFFFFF;
  --mist: #F4F0FA;          /* Lavender Mist */
  --mist-deep: #E9E2F4;     /* Lavender Mist, one step darker for rings and fills */
  --ink: #1F1631;           /* Deep Grape */
  --ink-2: #4A4160;
  --ink-3: #675E7A;
  --grape: #7A4FC6;         /* Grape Purple */
  --grape-dark: #6440A8;
  --line: rgba(31, 22, 49, 0.11);
  --line-strong: rgba(31, 22, 49, 0.2);

  --font-latin: "Outfit", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --rail-gap: 88px;          /* distance from the pipe to the content */
  --pad: clamp(88px, 11vw, 152px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: -0.012em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--grape); color: #fff; }
:focus-visible { outline: 2px solid var(--grape); outline-offset: 3px; border-radius: 4px; }

.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 {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; transition: top .2s;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 56px; padding: 0 30px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff;
  font: 600 16px/1 var(--font-body); letter-spacing: -0.01em;
  cursor: pointer; transition: background .3s var(--ease);
}
.btn:hover { background: var(--grape); }
.btn-block { width: 100%; }

.text-link {
  font-weight: 600; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px; text-underline-offset: 6px;
  transition: text-decoration-color .25s;
}
.text-link:hover { text-decoration-color: var(--grape); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand img { height: 37px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 34px; font-size: 15px; }
.site-nav a { color: var(--ink-2); transition: color .2s; }
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-cta {
  padding: 9px 18px; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink); font-weight: 600; transition: border-color .2s, background .2s;
}
.site-nav .nav-cta:hover { border-color: var(--ink); }

.nav-toggle {
  display: none; position: relative; width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; cursor: pointer; color: var(--ink);
}
.nav-toggle .bar {
  position: absolute; left: 12px; width: 20px; height: 1.5px; background: currentColor;
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav-toggle .bar:nth-of-type(1) { top: 18px; }
.nav-toggle .bar:nth-of-type(2) { top: 25px; }
.nav-toggle[aria-expanded="true"] .bar:nth-of-type(1) { top: 21.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-of-type(2) { top: 21.5px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 8vw, 112px) 0 clamp(24px, 4vw, 56px); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.55fr); align-items: center; gap: 48px; }

.hero h1 {
  font-family: var(--font-latin);
  font-size: clamp(44px, 6.6vw, 92px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.05em;
}
.hero .lead { margin-top: 32px; max-width: 30em; font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; margin-top: 44px; }

.hero-visual { position: relative; justify-self: end; width: min(100%, 380px); aspect-ratio: 1; display: grid; place-items: center; }
.hero-visual::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--mist);
}
.hero-visual::after {
  content: ""; position: absolute; inset: -28px; border-radius: 50%;
  border: 1px solid var(--line);
}
.flow-mark { position: relative; width: 66%; height: auto; overflow: visible; }
.flow-mark .pipe { fill: none; stroke: var(--grape); stroke-width: 9; stroke-linecap: butt; }
.flow-mark .pipe-round { stroke-linecap: round; stroke-linejoin: round; }
.flow-mark .particle { fill: #fff; }
.flow-mark .node { fill: var(--mist); stroke: var(--grape); stroke-width: 9; }
.flow-mark .tip, .flow-mark .out { fill: var(--grape); }

/* ---------- The pipe ---------- */
.stage { position: relative; padding: var(--pad) 0; }
.stage-tint { background: var(--mist); }

/* x position of the pipe, shared by the rail and the node marks */
.stage { --rail-x: calc(max(0px, (100% - var(--wrap)) / 2) + var(--gutter) + 10px); }
.rail {
  position: absolute; top: 0; bottom: 0; left: var(--rail-x); width: 2px;
  background: var(--mist-deep);
}
.stage-tint .rail { background: #DCD2EC; }
.rail-fill {
  position: absolute; left: 0; top: 0; width: 100%;
  height: calc(var(--fill, 0) * 100%);
  background: var(--grape);
}
.stage:first-child .rail { top: calc(var(--pad) + 22px); }
.stage-end .rail { bottom: auto; height: calc(var(--pad) + 22px); }

.stage-inner { position: relative; padding-left: calc(var(--gutter) + var(--rail-gap)); }
.node-mark {
  position: absolute; left: calc(var(--gutter) - 2px); top: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper); border: 6px solid #D6CBEA;
  transition: border-color .5s var(--ease);
}
.stage-tint .node-mark { background: var(--mist); }
.node-mark.lit { border-color: var(--grape); }
.node-out { width: 34px; height: 34px; left: calc(var(--gutter) - 6px); top: 6px; border: 0; background: #D6CBEA; transition: background .5s var(--ease), box-shadow .5s var(--ease); }
.node-out.lit { background: var(--grape); box-shadow: 0 0 0 10px rgba(122, 79, 198, 0.14); }

.stage-head { max-width: 640px; margin-bottom: clamp(48px, 6vw, 80px); }
.stage-head h2, .contact-copy h2 {
  font-family: var(--font-latin);
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.04em;
}
.stage-head p { margin-top: 18px; color: var(--ink-2); }

/* Name */
.name-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.name-formula {
  font-family: "Outfit", sans-serif; font-weight: 300;
  font-size: clamp(48px, 7vw, 96px); line-height: 1; letter-spacing: -0.045em; white-space: nowrap;
}
.name-formula span { color: var(--grape); }
.name-copy { display: grid; gap: 16px; max-width: 34em; font-size: 18px; }
.name-copy .quiet { font-size: 16px; color: var(--ink-3); }

/* Services */
.service-list { border-top: 1px solid var(--line-strong); }
.service {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 56px);
  padding: clamp(36px, 4vw, 52px) 0;
  border-bottom: 1px solid var(--line);
}
.service h3 { font-size: clamp(22px, 2.1vw, 27px); font-weight: 650; letter-spacing: -0.03em; line-height: 1.3; }
.service .en { margin-top: 6px; font-family: "Outfit", sans-serif; font-size: 15px; color: var(--ink-3); letter-spacing: 0; }
.service-body { display: grid; gap: 18px; align-content: start; color: var(--ink-2); }
.caveat { padding-left: 16px; border-left: 2px solid var(--grape); font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.scope { display: grid; gap: 6px; font-size: 15.5px; }
.scope li { position: relative; padding-left: 20px; }
.scope li::before {
  content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 8px;
  border: 2px solid var(--grape); border-radius: 50%;
}
.tools { margin-top: 18px; font-family: "Outfit", sans-serif; font-size: 14.5px; color: var(--ink-3); letter-spacing: 0; }

/* Process */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 3.5vw, 56px); row-gap: 56px; }
.steps li { padding-top: 22px; border-top: 1px solid var(--line-strong); }
.step-num { display: block; font-family: "Outfit", sans-serif; font-weight: 300; font-size: 44px; line-height: 1; color: var(--grape); letter-spacing: -0.04em; }
.steps h3 { margin-top: 22px; font-size: 20px; font-weight: 650; letter-spacing: -0.025em; }
.steps h3 small { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.steps p { margin-top: 10px; font-size: 15.5px; color: var(--ink-2); }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 72px); }
.principle { padding: 32px 0 36px; border-top: 1px solid var(--line-strong); }
.principle h3 { font-size: 21px; font-weight: 650; letter-spacing: -0.03em; }
.principle p { margin-top: 10px; color: var(--ink-2); max-width: 30em; }

/* FAQ */
.faq-list { max-width: 820px; border-top: 1px solid var(--line-strong); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  position: relative; display: block; cursor: pointer; list-style: none;
  padding: 26px 56px 26px 0; font-size: 18px; font-weight: 600; letter-spacing: -0.025em;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before, .faq-list summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 15px; height: 1.5px;
  background: var(--ink); transition: transform .3s var(--ease);
}
.faq-list summary::after { transform: rotate(90deg); }
.faq-list details[open] summary::after { transform: rotate(0deg); }
.faq-list summary:hover { color: var(--grape-dark); }
.faq-list details p { padding: 0 56px 28px 0; color: var(--ink-2); }

/* Contact */
.stage-end { padding-bottom: calc(var(--pad) * 0.9); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact-copy h2 { font-size: clamp(34px, 4.6vw, 58px); }
.contact-lead { margin-top: 22px; max-width: 28em; color: var(--ink-2); }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 48px; }
.mail {
  font-family: "Outfit", sans-serif; font-weight: 400;
  font-size: clamp(26px, 3.2vw, 40px); letter-spacing: -0.03em; line-height: 1.2;
  text-decoration: underline; text-decoration-color: var(--grape);
  text-decoration-thickness: 2px; text-underline-offset: 10px;
  transition: color .2s;
}
.mail:hover { color: var(--grape-dark); }
.copy {
  height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink-2); font: 500 13.5px var(--font-body); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.copy:hover { border-color: var(--ink); color: var(--ink); }
.copy.done { border-color: var(--grape); color: var(--grape-dark); }

.contact-form {
  display: grid; gap: 20px; padding: clamp(28px, 3.4vw, 44px);
  background: var(--mist); border-radius: 24px;
}
.form-hint { font-size: 14.5px; color: var(--ink-3); }
.field { display: grid; gap: 8px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  background: var(--paper); border: 1px solid transparent; color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.5;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 17px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field input::placeholder, .field textarea::placeholder { color: #9A93A8; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--grape); }
.field .invalid { box-shadow: inset 0 0 0 2px #C2416B; }
.field-error { font-size: 13.5px; color: #A8325A; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; font-size: 14.5px; }
.footer-inner img { width: 36px; height: 36px; }
.footer-name { font-family: "Outfit", sans-serif; font-weight: 500; font-size: 17px; }
.footer-name span { margin-left: 10px; font-family: var(--font-body); font-weight: 400; font-size: 14px; color: var(--ink-3); }
.footer-mail { margin-left: auto; color: var(--ink-2); }
.footer-mail:hover { color: var(--ink); }
.footer-copy { color: var(--ink-3); }

/* 404 */
.notfound { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 40px var(--gutter); text-align: center; }
.notfound img { width: 88px; height: 88px; }
.notfound h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 650; letter-spacing: -0.03em; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .service { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .service-title { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --rail-gap: 44px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 76px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px var(--gutter) 24px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: none; }
  .site-nav a { padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .site-nav .nav-cta { margin-top: 18px; text-align: center; border: 1px solid var(--ink); }

  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { order: -1; justify-self: start; width: min(52%, 220px); margin-left: 28px; }
  .hero-visual::after { inset: -16px; }

  .name-grid, .contact-grid { grid-template-columns: 1fr; }
  .service { grid-template-columns: 1fr; gap: 18px; }
  .principles { grid-template-columns: 1fr; }
  .node-mark { width: 22px; height: 22px; border-width: 5px; top: 8px; left: calc(var(--gutter) - 0px); }
  .node-out { width: 28px; height: 28px; left: calc(var(--gutter) - 3px); top: 5px; }
  .stage { --rail-x: calc(var(--gutter) + 10px); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .steps { grid-template-columns: 1fr; row-gap: 40px; }
  .field-row { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .footer-mail { margin-left: 0; }
  .faq-list summary { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
