/* 30 Seconds Insights Studio — shared styles (KO / EN / ZH) */

:root {
  --abyss: #060b14;
  --deep: #0c1420;
  --panel: #111b2a;
  --line: #1f2b3d;
  --line-strong: #2d3b52;
  --text: #e8ecf2;
  --muted: #8d99ac;
  --ice: #8fd3ff;
  --ice-dim: rgba(143, 211, 255, 0.14);
  --white: #ffffff;

  --serif: "Hahmlet", "Noto Serif SC", serif;
  --sans: "IBM Plex Sans KR", "Noto Sans SC", system-ui, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(88px, 12vw, 160px);
}

/* Chinese pages: Han glyphs from Noto SC, and normal line breaking (keep-all would block breaks between Han characters) */
html[lang="zh-CN"] {
  --serif: "Noto Serif SC", "Hahmlet", serif;
  --sans: "Noto Sans SC", "IBM Plex Sans KR", system-ui, sans-serif;
}
html[lang="zh-CN"] body { word-break: normal; line-break: strict; }
html[lang="en"] body { word-break: normal; overflow-wrap: break-word; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--abyss);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 2px; }

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

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.site-header:not(.is-solid) { background: linear-gradient(180deg, rgba(6,11,20,.75), rgba(6,11,20,0)); }
.site-header.is-solid { background: rgba(6, 11, 20, .92); backdrop-filter: blur(10px); border-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { text-decoration: none; font-family: "Hahmlet", serif; font-weight: 600; font-size: 19px; letter-spacing: .01em; white-space: nowrap; }
.brand small { font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { text-decoration: none; font-size: 15px; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--text); }
.lang { display: flex; gap: 2px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.lang a { font-size: 13px; padding: 3px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.lang a[aria-current="true"] { background: var(--text); color: var(--abyss); }
.menu-btn { display: none; background: none; border: 0; color: var(--text); width: 44px; height: 44px; cursor: pointer; }
.menu-btn svg { width: 24px; height: 24px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6,11,20,.96) 0%, rgba(6,11,20,.82) 38%, rgba(6,11,20,.2) 75%, rgba(6,11,20,.35) 100%),
    linear-gradient(0deg, var(--abyss) 0%, rgba(6,11,20,0) 35%);
}
.hero .wrap { position: relative; z-index: 1; padding-bottom: clamp(72px, 12vh, 140px); padding-top: 140px; }
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(36px, 5.4vw, 74px); line-height: 1.16; letter-spacing: -.02em;
  margin: 0; max-width: 13em;
}
.hero h1 .line { display: block; }
.hero p.lead { margin: 32px 0 0; max-width: 34em; font-size: clamp(16px, 1.5vw, 19px); color: #c3ccd9; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 44px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border-radius: 999px;
  font: 500 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--white); color: var(--abyss); }
.btn-primary:hover { background: var(--ice); }
.btn-ghost { border-color: rgba(232,236,242,.35); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--text); }

/* hero load sequence — the one orchestrated moment */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .line, .hero .lead, .hero .actions { opacity: 0; transform: translateY(18px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
  .hero h1 .line:nth-child(2) { animation-delay: .15s; }
  .hero .lead { animation-delay: .45s; }
  .hero .actions { animation-delay: .6s; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Section frame ---------- */
section.block { padding: var(--section) 0; }
.block-head { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: end; margin-bottom: clamp(48px, 7vw, 88px); }
.block-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4vw, 52px); line-height: 1.22; letter-spacing: -.015em; margin: 0; }
.block-head p { margin: 0; color: var(--muted); max-width: 36em; }

/* ---------- Services ---------- */
.services { border-top: 1px solid var(--line); }
.service {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px;
  padding: 36px 0; border-bottom: 1px solid var(--line);
}
.service h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 2.4vw, 30px); margin: 0; line-height: 1.3; }
.service p { margin: 0 0 14px; color: #c3ccd9; max-width: 36em; }
.service ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.service li { font-size: 14px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; }
.badge {
  display: inline-block; vertical-align: middle; margin-left: 10px;
  font: 500 12px/1 var(--sans); color: var(--ice); background: var(--ice-dim); padding: 6px 10px; border-radius: 999px;
}

/* ---------- Work (client cases) ---------- */
.work { background: var(--deep); }
.case { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.case + .case { margin-top: clamp(72px, 10vw, 128px); }
.case:nth-child(even) { grid-template-columns: 1fr 1.35fr; }
.case:nth-child(even) .case-media { order: 2; }
.case-media {
  aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--panel);
  border: 1px solid var(--line); position: relative;
}
.case-media img { width: 100%; height: 100%; object-fit: cover; }
.case-media .pending {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 14px; padding: 24px;
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.018) 14px 28px);
}
.case-sector { font-size: 14px; color: var(--ice); margin: 0 0 12px; }
.case h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 38px); line-height: 1.25; margin: 0 0 18px; }
.case p { margin: 0 0 24px; color: #c3ccd9; }
.case dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 15px; }
.case dt { color: var(--muted); }
.case dd { margin: 0; }

/* ---------- Own products ---------- */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product { display: flex; flex-direction: column; }
.product .thumb { aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 24px 0 8px; }
.product p { margin: 0 0 16px; color: #c3ccd9; font-size: 16px; }
.status { margin-top: auto; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ice); }
.status.beta::before { background: transparent; border: 1.5px solid var(--ice); }
.status a { color: var(--text); }

/* ---------- Process (true sequence) ---------- */
.process { background: var(--deep); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); counter-reset: step; border-top: 1px solid var(--line-strong); }
.steps li { counter-increment: step; padding: 28px 20px 0 0; position: relative; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-family: var(--serif); font-size: 15px; color: var(--ice); margin-bottom: 18px;
}
.steps li::after { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--ice); }
.steps h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 10px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(40px, 6vw, 96px); }
.contact-grid h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4vw, 52px); line-height: 1.22; margin: 0 0 24px; }
.contact-grid .aside p { color: var(--muted); margin: 0 0 32px; }
.contact-grid .aside a.mail { font-family: var(--serif); font-size: 20px; text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 4px; }
.contact-grid .aside a.mail:hover { border-color: var(--ice); }
form.inquiry { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label, .field legend { font-size: 14px; color: var(--muted); }
.field input, .field textarea, .field select {
  font: 16px/1.5 var(--sans); color: var(--text); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 13px 14px; width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ice); }
fieldset.field { border: 0; padding: 0; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-block; font-size: 15px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.chips input:checked + span { background: var(--text); color: var(--abyss); border-color: var(--text); }
.chips input:focus-visible + span { outline: 2px solid var(--ice); outline-offset: 2px; }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.form-foot small { color: var(--muted); font-size: 13px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* ---------- AI consult chatbot ---------- */
.chat-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 18px;
  border-radius: 999px; border: 1px solid rgba(143,211,255,.45);
  background: rgba(12,20,32,.92); backdrop-filter: blur(8px); color: var(--text);
  font: 500 15px/1 var(--sans); cursor: pointer; box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
.chat-launch .orb { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0, var(--ice) 45%, #2a6f9e 100%); }
.chat-panel {
  position: fixed; right: 20px; bottom: 88px; z-index: 60;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100svh - 120px));
  display: flex; flex-direction: column;
  background: var(--deep); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6); overflow: hidden;
  transform-origin: bottom right; transition: opacity .2s, transform .2s;
}
.chat-panel[hidden] { display: flex; opacity: 0; transform: scale(.96) translateY(8px); pointer-events: none; visibility: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat-head strong { font-family: var(--serif); font-weight: 500; font-size: 17px; display: block; }
.chat-head span { font-size: 13px; color: var(--muted); }
.chat-close { background: none; border: 0; color: var(--muted); width: 36px; height: 36px; cursor: pointer; font-size: 22px; line-height: 1; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 85%; padding: 11px 14px; border-radius: 12px; font-size: 15px; line-height: 1.6; }
.msg.bot { background: var(--panel); border-top-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--text); color: var(--abyss); border-top-right-radius: 4px; align-self: flex-end; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { font: 14px var(--sans); color: var(--text); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.quick button:hover { border-color: var(--ice); }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; font: 15px var(--sans); color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 16px; height: 44px; min-width: 0; }
.chat-input input:focus { outline: none; border-color: var(--ice); }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.send { background: var(--text); color: var(--abyss); border-color: var(--text); }
.icon-btn.mic[aria-pressed="true"] { border-color: var(--ice); color: var(--ice); background: var(--ice-dim); }
.chat-note { font-size: 12px; color: var(--muted); text-align: center; padding: 0 12px 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .block-head, .service, .contact-grid { grid-template-columns: 1fr; gap: 16px; }
  .case, .case:nth-child(even) { grid-template-columns: 1fr; }
  .case:nth-child(even) .case-media { order: 0; }
  .products { grid-template-columns: 1fr; gap: 56px; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
}
@media (max-width: 760px) {
  .nav { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 0; background: rgba(6,11,20,.98); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 24px; display: none; }
  .nav.is-open { display: flex; }
  .nav > a { padding: 14px 0; width: 100%; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav .lang { margin-top: 20px; }
  .menu-btn { display: grid; place-items: center; }
  .site-header { background: rgba(6,11,20,.92); backdrop-filter: blur(10px); }
  .hero::after { background: linear-gradient(0deg, var(--abyss) 8%, rgba(6,11,20,.78) 55%, rgba(6,11,20,.45) 100%); }
  .hero video { object-position: 78% center; }
  form.inquiry { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .chat-launch .label { display: none; }
  .chat-launch { padding: 0; width: 56px; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chat-panel { transition: none; }
}

/* ---------- Case study detail pages ---------- */
.case-link { display: inline-block; margin-top: 28px; font-size: 15px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-strong); padding-bottom: 3px; }
.case-link:hover { border-color: var(--ice); }

.cs-hero { padding: 152px 0 0; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 40px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.cs-hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(36px, 5.6vw, 72px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 24px; }
.cs-hero .lead { font-size: clamp(17px, 1.6vw, 20px); color: #c3ccd9; max-width: 36em; margin: 0; }
.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 56px 0 0; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-meta dt { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.cs-meta dd { margin: 0; font-size: 16px; }
.cs-meta a { color: var(--text); }
.cs-cover { margin-top: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.cs-cover img { width: 100%; height: auto; }

.cs-section { padding: clamp(72px, 10vw, 128px) 0 0; }
.cs-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(32px, 5vw, 72px); }
.cs-row h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 38px); line-height: 1.25; margin: 0; }
.cs-row .body p { margin: 0 0 18px; color: #c3ccd9; max-width: 38em; }
.cs-row .body p:last-child { margin-bottom: 0; }

.apps { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 8px; }
.app { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.app h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0; }
.app p { margin: 0; color: #c3ccd9; }
.app .who { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; font-family: var(--sans); }

.flow { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 0; counter-reset: flow; }
.flow li { counter-increment: flow; display: flex; align-items: center; font-size: 15px; }
.flow li span { border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 16px; background: var(--panel); }
.flow li span::before { content: counter(flow); color: var(--ice); margin-right: 8px; font-family: var(--serif); }
.flow li + li::before { content: ""; width: 20px; height: 1px; background: var(--line-strong); }

.also { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.also li { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 180px 1fr; gap: 24px; }
.also strong { font-weight: 500; }
.also span { color: #c3ccd9; }

.cs-cta { margin-top: clamp(88px, 12vw, 160px); background: var(--deep); padding: clamp(64px, 9vw, 112px) 0; }
.cs-cta .wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.cs-cta h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.25; margin: 0 0 12px; }
.cs-cta p { margin: 0; color: var(--muted); }
.cs-next { display: flex; justify-content: space-between; gap: 24px; padding: 40px 0; border-bottom: 1px solid var(--line); }
.cs-next a { text-decoration: none; }
.cs-next small { display: block; color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.cs-next strong { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.cs-next .next { text-align: right; margin-left: auto; }

@media (max-width: 960px) {
  .cs-row { grid-template-columns: 1fr; gap: 20px; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app, .also li { grid-template-columns: 1fr; gap: 6px; }
  .flow { flex-direction: column; align-items: flex-start; gap: 0; }
  .flow li { flex-direction: column; align-items: flex-start; }
  .flow li + li::before { width: 1px; height: 14px; margin-left: 22px; }
}
.product .case-link { align-self: flex-start; margin-top: 20px; }
.case-media .gallery-wait { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; background: radial-gradient(ellipse at 30% 20%, rgba(143,211,255,.07), transparent 60%), var(--panel); }
.case-media .gallery-wait span { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 32px); color: var(--text); }
.case-media .gallery-wait small { font-size: 14px; color: var(--muted); }

/* live chat states */
.msg.pending { color: var(--muted); font-style: italic; background: transparent; border: 1px dashed var(--line-strong); }
.chat-input input:disabled { opacity: .6; }
.icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled { opacity: .7; cursor: default; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
