/* =========================================================
   DESIGNGAGE_HOMES — 다자인가게
   Minimal Modern Design System (white / black)
   ========================================================= */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  font-family: 'Inter', 'Pretendard', 'Apple SD Gothic Neo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
img, picture, svg, video { 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; }

/* --- Tokens --- */
:root {
  --ink:        #0a0a0a;
  --ink-soft:   #1a1a1a;
  --ink-mute:   #6b6b6b;
  --ink-line:   #e5e5e5;
  --paper:      #ffffff;
  --paper-warm: #f6f4ef;
  --paper-cool: #f4f4f4;
  --accent:     #c8a572;     /* warm gold accent */
  --shadow-sm:  0 1px 2px rgba(10,10,10,.05);
  --shadow-md:  0 8px 24px rgba(10,10,10,.08);
  --shadow-lg:  0 24px 60px rgba(10,10,10,.12);

  --serif: 'Cormorant Garamond', 'Noto Serif KR', 'Times New Roman', serif;
  --display-weight: 400;

  --container: 1280px;
  --container-narrow: 960px;
  --ease: cubic-bezier(.22,.61,.36,1);

  --header-h: 72px;
  --chips-h: 0px;
  --gutter: clamp(1rem, 4vw, 1.5rem);
}
@media (max-width: 720px) {
  :root { --header-h: 76px; }
}

/* --- Typography --- */
.h-display {
  font-family: var(--serif);
  font-weight: var(--display-weight);
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.h-xl {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.h-lg { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.5vw, 2.2rem); line-height: 1.2; }
.h-md { font-weight: 600; font-size: 1.125rem; letter-spacing: -0.005em; }
.eyebrow {
  font-size: .75rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.lede { font-size: 1.125rem; color: var(--ink-mute); max-width: 60ch; }
.muted { color: var(--ink-mute); }

/* --- Layout --- */
.container { width: min(100% - (var(--gutter) * 2), var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - (var(--gutter) * 2), var(--container-narrow)); margin-inline: auto; }
.section { padding: clamp(4rem, 9vw, 8rem) 0; }
.section-tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.grid { display: grid; gap: 2rem; }
.row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .9rem 1.6rem;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  font-size: .875rem; letter-spacing: .04em; text-transform: uppercase;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--light:hover { background: transparent; color: var(--paper); border-color: var(--paper); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* --- Header / Nav --- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
@media (max-width: 880px) {
  .site-header {
    background: rgba(255,255,255,.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
.site-header.scrolled { border-color: var(--ink-line); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h);
  padding: .5rem 0;
}
.brand { display: flex; align-items: baseline; gap: .55rem; }
.brand__mark {
  font-family: var(--serif);
  font-size: 1.4rem; line-height: 1;
  letter-spacing: -.01em;
}
.brand__sub {
  font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-mute);
}
.nav__menu { display: flex; gap: 2rem; align-items: center; }
.nav__menu a {
  font-size: .875rem; letter-spacing: .02em;
  position: relative; padding-block: .25rem;
  color: var(--ink-soft);
}
.nav__menu a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease);
}
.nav__menu a:hover::after, .nav__menu a.active::after { transform: scaleX(1); transform-origin: left; }
.nav__cta { margin-left: 1rem; }

.nav-toggle { display: none; width: 40px; height: 40px; position: relative; }
.nav-toggle span {
  position: absolute; left: 8px; right: 8px; height: 1px; background: var(--ink);
  transition: transform .35s var(--ease), opacity .25s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle.open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

@media (max-width: 720px) {
  .nav { align-items: flex-end; padding: 0 0 .55rem; }
  /* Higher-specificity selectors so these win against the
     "max-width: 1100px" rule that lives later in the file. */
  .site-header .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
  }
  .site-header .brand__mark { font-size: 1.15rem; line-height: 1.1; }
  .site-header .brand__sub {
    display: block;
    font-size: .58rem;
    letter-spacing: .2em;
    text-transform: uppercase;
  }
  .nav-toggle { margin-bottom: -4px; }
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav__menu {
    position: fixed; inset: var(--header-h) 0 0 0;
    flex-direction: column; align-items: stretch;
    gap: 0;
    padding: 1.25rem var(--gutter) 2rem;
    background: var(--paper);
    transform: translateY(-110%);
    transition: transform .4s var(--ease);
    border-top: 1px solid var(--ink-line);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav__menu.open { transform: translateY(0); }
  .nav__menu a {
    font-size: 1.15rem;
    font-family: var(--serif);
    padding-block: .85rem;
    width: 100%;
    border-bottom: 1px solid var(--ink-line);
    color: var(--ink);
  }
  .nav__menu a::after { display: none; }
  .nav__cta {
    margin: 1.25rem 0 0;
    justify-content: center;
    border-bottom: none !important;
    font-family: inherit !important;
    font-size: .875rem !important;
  }
  .lang-switch {
    margin: 1rem 0 0;
    display: flex;
    gap: .5rem;
    justify-content: center;
    border: none;
  }
  .lang-switch button {
    padding: .5rem .9rem;
    border: 1px solid var(--ink-line);
    background: transparent;
    font-size: .75rem;
    letter-spacing: .1em;
    min-height: 40px;
    min-width: 48px;
  }
  .lang-switch button.active,
  .lang-switch button.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  body.nav-open { overflow: hidden; }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid; grid-template-rows: 1fr auto;
  padding-top: calc(var(--header-h) + var(--chips-h) + 20px);
  overflow: hidden;
  background: var(--paper);
}
.hero__media {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #1a1714;  /* fallback while images load */
  z-index: 0;
}
.hero__media::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,.7) 100%);
  z-index: 2;
}

/* --- Hero slides (auto-advancing carousel) --- */
.hero__slides { position: absolute; inset: 0; z-index: 0; }
.hero__slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 50%;
  filter: saturate(.95) contrast(1.02);
  opacity: 0;
  transform: translateX(8%) scale(1.06);
  transition:
    opacity .8s cubic-bezier(.22,1,.36,1),
    transform 4.5s cubic-bezier(.22,1,.36,1);
  will-change: opacity, transform;
}
.hero__slide.is-active {
  opacity: 1;
  transform: translateX(0) scale(1);  /* slow Ken-Burns drift while active */
  z-index: 1;
}
.hero__slide.is-leaving {
  opacity: 0;
  transform: translateX(-8%) scale(1.04);
  z-index: 0;
}

/* --- Hero pagination dots --- */
.hero__dots {
  position: absolute;
  right: clamp(1.25rem, 3vw, 2.5rem);
  bottom: clamp(5.5rem, 9vh, 7rem);
  z-index: 3;
  display: flex; gap: .55rem;
}
.hero__dot {
  position: relative;
  width: 26px; height: 2px;
  border: none; padding: 0;
  background: rgba(255,255,255,.35);
  cursor: pointer;
  transition: background .35s var(--ease), width .35s var(--ease);
}
/* Invisible expanded hit area — makes the 2px-tall bar comfortable to click. */
.hero__dot::before {
  content: '';
  position: absolute;
  inset: -14px -4px;
}
.hero__dot:hover { background: rgba(255,255,255,.7); }
.hero__dot:focus-visible { outline: 2px solid rgba(255,255,255,.85); outline-offset: 6px; }
.hero__dot.is-active {
  background: var(--paper);
  width: 44px;
}

/* Project label crossfade — coordinates with slide transition */
#heroProject {
  display: inline-block;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
#heroProject.is-swapping { opacity: 0; transform: translateY(2px); }
@media (prefers-reduced-motion: reduce) {
  .hero__slide { transition: opacity .25s linear; transform: none !important; }
}
.hero__inner {
  position: relative; z-index: 1;
  align-self: end;
  padding: 3rem 0 4rem;
  color: var(--paper);
}
.hero__inner .container { display: grid; gap: 1.5rem; }
.hero__title { color: var(--paper); }
.hero__title em { font-style: italic; color: var(--accent); }
.hero__sub { color: rgba(255,255,255,.86); max-width: 56ch; font-size: 1.05rem; }
.hero__meta {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: end; gap: 2rem;
  padding: 1.25rem 0 2rem;
  color: rgba(255,255,255,.85);
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
  border-top: 1px solid rgba(255,255,255,.25);
  margin-top: 2rem;
}
.hero__meta .container { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }

/* --- Marquee / Tagline strip --- */
.marquee {
  border-block: 1px solid var(--ink-line);
  background: var(--paper-warm);
  overflow: hidden;
  padding: 1.25rem 0;
}
.marquee__track {
  display: flex; gap: 3rem; white-space: nowrap;
  animation: marquee 35s linear infinite;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  color: var(--ink);
}
.marquee__track span { opacity: .85; }
.marquee__track .dot { opacity: .35; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* --- Section heads --- */
.sec-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-bottom: 3rem;
  align-items: end;
}
.sec-head__title { }
.sec-head__lede { color: var(--ink-mute); font-size: 1.05rem; max-width: 52ch; }
@media (max-width: 720px) {
  .sec-head { grid-template-columns: 1fr; }
}

/* --- Cards & feature blocks --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--ink-line);
  border: 1px solid var(--ink-line);
}
.feature {
  background: var(--paper);
  padding: 2.5rem 2rem;
  display: grid; gap: 1rem;
  transition: background .3s var(--ease);
}
.feature:hover { background: var(--paper-warm); }
.feature__num {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--accent);
}
.feature__title { font-weight: 600; font-size: 1.125rem; }
.feature__body { color: var(--ink-mute); font-size: .95rem; }

/* --- Portfolio / Projects --- */
.portfolio {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}
.project {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--paper-cool);
}
.project--wide { grid-column: span 7; aspect-ratio: 16 / 10; }
.project--tall { grid-column: span 5; }
.project--half { grid-column: span 6; aspect-ratio: 4 / 3; }
.project--full { grid-column: span 12; aspect-ratio: 21 / 9; }
.project img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.project:hover img { transform: scale(1.04); }
.project__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.55) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem 1.6rem;
  color: var(--paper);
}
.project__cat { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.project__title { font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; margin-top: .4rem; }
@media (max-width: 880px) {
  .project--wide, .project--tall, .project--half, .project--full { grid-column: span 12; aspect-ratio: 4 / 3; }
}

/* --- Stats --- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-block: 1px solid var(--ink-line);
}
.stat {
  padding: 2.5rem 1.5rem;
  border-right: 1px solid var(--ink-line);
}
.stat:last-child { border-right: none; }
.stat__num { font-family: var(--serif); font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: 1; }
.stat__label { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-mute); margin-top: .6rem; }
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--ink-line); }
}

/* --- Split content --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.split__media { aspect-ratio: 4 / 5; overflow: hidden; }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }

/* --- Team --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.team-card { }
.team-card__photo {
  aspect-ratio: 3 / 4; overflow: hidden;
  background: var(--paper-cool);
  filter: grayscale(1) contrast(1.05);
  transition: filter .5s var(--ease);
}
.team-card:hover .team-card__photo { filter: grayscale(0); }
.team-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.team-card__name { margin-top: 1rem; font-family: var(--serif); font-size: 1.4rem; }
.team-card__role { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-mute); }

/* --- Process timeline --- */
.process {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  counter-reset: step;
}
.process__step {
  border-top: 1px solid var(--ink);
  padding-top: 1.25rem;
  position: relative;
  counter-increment: step;
}
.process__step::before {
  content: '0' counter(step);
  font-family: var(--serif); font-size: 1.2rem;
  color: var(--accent);
  display: block; margin-bottom: .5rem;
}
.process__step h3 { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.process__step p { font-size: .9rem; color: var(--ink-mute); }
@media (max-width: 1100px) { .process { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .process { grid-template-columns: repeat(2, 1fr); gap: 1.25rem 1rem; } }
@media (max-width: 420px)  { .process { grid-template-columns: 1fr; } }

/* --- CTA strip --- */
.cta-strip {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3.5rem, 7vw, 6rem) 0;
}
.cta-strip h2 { color: var(--paper); }
.cta-strip .lede { color: rgba(255,255,255,.7); }
.cta-strip .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cta-strip .btn:hover { background: transparent; color: var(--paper); }
/* Ghost variant inside CTA strip — transparent box, white text */
.cta-strip .btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(255, 255, 255, .5);
}
.cta-strip .btn--ghost:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* CTA buttons on the left, social icons on the right */
.cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-social {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0;
  padding: 0;
}
.cta-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  color: var(--paper);
  transition: background .25s var(--ease),
              border-color .25s var(--ease),
              color .25s var(--ease),
              transform .25s var(--ease);
}
.cta-social a:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}
.cta-social a:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}
.cta-social svg {
  width: 19px; height: 19px;
  display: block;
}
@media (max-width: 520px) {
  .cta-row { gap: 1.25rem; }
  .cta-social a { width: 40px; height: 40px; }
  .cta-social svg { width: 17px; height: 17px; }
}

/* --- Mobile polish: tighter paddings on cards & sections --- */
@media (max-width: 720px) {
  .feature { padding: 1.75rem 1.25rem; }
  .stat    { padding: 1.75rem 1rem; }
  .project__overlay { padding: 1.1rem 1.1rem; }
  .project__title   { font-size: 1.2rem; }
  .hero__inner { padding: 2rem 0 3rem; }
  .hero__meta {
    font-size: .65rem;
    letter-spacing: .15em;
    padding: .9rem 0 1.5rem;
    margin-top: 1.25rem;
  }
  .hero__meta .container { gap: .75rem 1.25rem; }
  .marquee { padding: .85rem 0; }
  .marquee__track { gap: 1.75rem; }
  .row { gap: .9rem; }
  .grid { gap: 1.5rem; }
  .btn { padding: .8rem 1.25rem; font-size: .8rem; }
}
@media (max-width: 420px) {
  .feature { padding: 1.5rem 1rem; }
  .stat    { padding: 1.5rem .75rem; }
  .stat__num { font-size: 2rem; }
  .stat__label { font-size: .7rem; letter-spacing: .14em; }
  .hero__sub { font-size: .95rem; }
}

/* --- Footer --- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.75);
  padding: 4rem 0 1.5rem;
}
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: var(--paper); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer-grid h4 {
  font-size: .75rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-bottom: 1rem;
}
.footer-grid p, .footer-grid a { font-size: .9rem; line-height: 1.8; }
.footer-grid ul { list-style: none; display: grid; gap: .35rem; }
.site-footer__brand .brand__mark { color: var(--paper); }
.site-footer__brand .brand__sub { color: rgba(255,255,255,.5); }
.site-footer__brand p { margin-top: 1rem; font-size: .9rem; max-width: 36ch; color: rgba(255,255,255,.6); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.5rem;
  font-size: .78rem; color: rgba(255,255,255,.5);
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* --- Page hero (interior pages) --- */
.page-hero {
  padding: 11rem 0 4rem;
  border-bottom: 1px solid var(--ink-line);
}
.page-hero h1 { margin-top: 1rem; }
.page-hero .lede { margin-top: 1.5rem; }

/* --- AI Section UI --- */
.ai-tabs {
  display: flex; gap: .5rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--ink-line);
  margin-bottom: 2.5rem;
}
.ai-tab {
  padding: 1rem 1.4rem; font-size: .9rem; letter-spacing: .04em;
  border-bottom: 2px solid transparent;
  color: var(--ink-mute);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.ai-tab.active, .ai-tab:hover { color: var(--ink); border-bottom-color: var(--ink); }

.ai-panel { display: none; }
.ai-panel.active { display: grid; gap: 2rem; }

.ai-card {
  border: 1px solid var(--ink-line);
  background: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: grid; gap: 1.25rem;
}
.ai-card h3 { font-family: var(--serif); font-size: 1.6rem; }
.ai-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 880px) { .ai-grid-2 { grid-template-columns: 1fr; } }

.chat-window {
  border: 1px solid var(--ink-line);
  border-radius: 0;
  background: var(--paper-warm);
  height: 360px; overflow-y: auto;
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: .85rem;
}
.chat-msg { max-width: 86%; padding: .8rem 1rem; font-size: .95rem; line-height: 1.55; }
.chat-msg.bot   { align-self: flex-start; background: var(--paper); border: 1px solid var(--ink-line); }
.chat-msg.user  { align-self: flex-end;   background: var(--ink); color: var(--paper); }
.chat-input { display: flex; gap: .5rem; margin-top: 1rem; }
.chat-input input {
  flex: 1; padding: .9rem 1rem; border: 1px solid var(--ink-line); background: var(--paper);
}
.chat-input input:focus { outline: 1px solid var(--ink); }

.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  padding: .5rem .9rem; font-size: .82rem;
  border: 1px solid var(--ink-line); background: var(--paper);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chip:hover, .chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.upload {
  border: 1.5px dashed var(--ink-line);
  background: var(--paper-warm);
  padding: 3rem 1.5rem; text-align: center;
  display: grid; gap: .75rem; place-content: center; place-items: center;
  min-height: 280px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.upload.drag { border-color: var(--ink); background: var(--paper-cool); }
.upload__icon { font-family: var(--serif); font-size: 2.4rem; color: var(--ink-mute); }
.upload input[type="file"] { display: none; }

.preview-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: center; }
.preview-pair > div { background: var(--paper-cool); aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; position: relative; }
.preview-pair > div span { position: absolute; top: .6rem; left: .6rem; background: var(--paper); padding: .25rem .55rem; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; }
.preview-pair img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) { .preview-pair { grid-template-columns: 1fr; } }

.estimator { display: grid; gap: 1.25rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); }
.field input, .field select, .field textarea {
  padding: .85rem 1rem;
  border: 1px solid var(--ink-line); background: var(--paper);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 1px solid var(--ink); }
.estimate-result {
  margin-top: 1rem; padding: 1.5rem;
  background: var(--ink); color: var(--paper);
  display: grid; gap: .25rem;
}
.estimate-result .price { font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--accent); }
.estimate-result .note  { font-size: .85rem; color: rgba(255,255,255,.7); }

/* --- Contact form --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.form-grid { display: grid; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 880px) {
  .contact-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* --- Reveal animation --- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* --- File uploader (contact form) --- */
.file-uploader { display: grid; gap: .6rem; }
.file-uploader__btn {
  display: flex; align-items: center; gap: .8rem;
  width: 100%;
  padding: 1rem 1.2rem;
  background: var(--paper-warm);
  border: 1.5px dashed var(--ink-line);
  color: var(--ink-soft);
  font-size: .92rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.file-uploader__btn:hover {
  border-color: var(--ink);
  background: var(--paper-cool);
}
.file-uploader__icon {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-mute);
}
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.file-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .8rem;
  align-items: center;
  padding: .55rem .8rem;
  background: var(--paper);
  border: 1px solid var(--ink-line);
  font-size: .88rem;
}
.file-item__name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.file-item__size { color: var(--ink-mute); font-size: .78rem; }
.file-item__rm {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--ink-line);
  color: var(--ink-mute);
  font-size: 1.1rem; line-height: 1;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.file-item__rm:hover {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

/* --- Consent (privacy) --- */
.consent-field { margin-top: .4rem; }
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ink-soft);
  cursor: pointer;
}
.consent-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--ink);
  cursor: pointer;
}
.consent-detail {
  margin-top: .8rem;
  padding: .85rem 1rem;
  background: var(--paper-warm);
  border: 1px solid var(--ink-line);
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink-mute);
}
.consent-detail p { margin: 0 0 .45rem; }
.consent-detail p:last-child { margin-bottom: 0; }
.consent-detail strong { color: var(--ink-soft); }

.field-error {
  margin-top: .5rem;
  padding: .5rem .75rem;
  background: #fff5f3;
  border: 1px solid #f0b4a8;
  color: #a04030;
  font-size: .82rem;
}

/* --- Cal.com inline embed --- */
.cal-embed {
  border: 1px solid var(--ink-line);
  background: var(--paper);
  overflow: hidden;
  min-height: 320px;
}
#cal-inline-container {
  min-height: 320px;
  display: grid;
  place-items: center;
}
.center { text-align: center; }

/* --- Language switcher --- */
.lang-switch {
  display: inline-flex; gap: 0; align-items: center;
  border: 1px solid var(--ink-line);
  margin-left: 1rem;
}
.lang-switch button {
  padding: .35rem .55rem;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-mute);
  border-right: 1px solid var(--ink-line);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.lang-switch button:last-child { border-right: none; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { background: var(--ink); color: var(--paper); }
@media (max-width: 880px) {
  .lang-switch { margin: 1rem 0 0; }
}

/* Chat typing indicator */
.chat-msg.bot.typing {
  display: inline-flex; gap: .25rem; align-items: center;
}
.chat-msg.bot.typing::after {
  content: '●●●'; letter-spacing: .15em; opacity: .4;
  animation: typing 1.2s ease-in-out infinite;
}
@keyframes typing {
  0%, 80%, 100% { opacity: .2; }
  40%           { opacity: .8; }
}

/* AI analysis result block */
.ai-analysis {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper-warm);
  border: 1px solid var(--ink-line);
  display: grid; gap: 1rem;
}
.ai-analysis h4 { font-family: var(--serif); font-size: 1.2rem; }
.ai-analysis .palette { display: flex; gap: .4rem; flex-wrap: wrap; }
.ai-analysis .palette span {
  font-size: .8rem; padding: .3rem .65rem;
  background: var(--paper); border: 1px solid var(--ink-line);
}
.ai-analysis ul { list-style: none; display: grid; gap: .6rem; padding-left: 0; }
.ai-analysis li { font-size: .92rem; line-height: 1.55; }
.ai-analysis li strong { color: var(--ink); }

/* --- Utilities --- */
.center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.divider { border-top: 1px solid var(--ink-line); }


/* --- AI data-flow disclosure (chat / redesign cards) --- */
.ai-disclosure {
  margin-top: 1rem;
  padding: .7rem .85rem;
  background: var(--paper-warm);
  border: 1px solid var(--ink-line);
  font-size: .78rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.ai-disclosure strong { color: var(--ink); font-weight: 600; }
.ai-disclosure a {
  text-decoration: underline;
  color: var(--ink);
  white-space: nowrap;
  margin-left: .15rem;
}

/* =========================================================
   ADMIN PAGE
   ========================================================= */
.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background: var(--paper-warm);
}
.admin-login__card {
  background: var(--paper);
  border: 1px solid var(--ink-line);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
}

.admin-shell {
  min-height: 100vh;
  background: var(--paper-warm);
  padding-bottom: 4rem;
}
.admin-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--ink-line);
  padding: 1rem clamp(1rem, 3vw, 2rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.admin-bar__left { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.admin-bar__right { display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-bar .btn {
  padding: .55rem 1rem;
  font-size: .78rem;
  letter-spacing: .04em;
}

.admin-banner {
  margin: 1rem clamp(1rem, 3vw, 2rem);
  padding: .8rem 1rem;
  border: 1px solid var(--ink-line);
  background: var(--paper);
  font-size: .9rem;
}
.admin-banner--ok { border-color: #b5d4b1; background: #f0f8ee; color: #2d5a26; }
.admin-banner--err { border-color: #f0b4a8; background: #fff5f3; color: #a04030; }

.admin-section {
  margin: 1.5rem clamp(1rem, 3vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--ink-line);
  padding: 1.5rem clamp(1rem, 3vw, 1.75rem);
}
.admin-section h2 { color: var(--ink); margin-bottom: 1rem; }
.admin-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.admin-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 720px) { .admin-settings { grid-template-columns: 1fr; } }

.admin-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.admin-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .75rem;
  background: var(--paper-warm);
  border: 1px solid var(--ink-line);
}
.admin-item__thumb {
  width: 120px; height: 70px;
  background: var(--paper-cool);
  overflow: hidden;
}
.admin-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-item__main { min-width: 0; }
.admin-item__line { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; font-size: .95rem; }
.admin-item__sub { font-size: .78rem; margin-top: .25rem; word-break: break-all; }
.admin-item__actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.admin-item__actions button {
  padding: .45rem .7rem;
  border: 1px solid var(--ink-line);
  background: var(--paper);
  font-size: .78rem;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.admin-item__actions button:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.admin-item__actions button:disabled { opacity: .35; cursor: not-allowed; }
.admin-item__actions button.danger:hover { background: #a04030; color: var(--paper); border-color: #a04030; }

.admin-pill {
  display: inline-block;
  padding: .15rem .55rem;
  background: var(--ink);
  color: var(--paper);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.admin-pill--ghost {
  background: transparent;
  color: var(--ink-mute);
  border: 1px solid var(--ink-line);
}

@media (max-width: 720px) {
  .admin-item { grid-template-columns: 90px 1fr; grid-template-rows: auto auto; }
  .admin-item__thumb { width: 90px; height: 60px; }
  .admin-item__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---- Modal ---- */
.admin-modal {
  position: fixed; inset: 0;
  background: rgba(10,10,10,.55);
  z-index: 200;
  display: grid; place-items: center;
  padding: 1rem;
  animation: lightboxFadeIn .25s var(--ease);
}
.admin-modal[hidden] { display: none; }
.admin-modal__card {
  background: var(--paper);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  border: 1px solid var(--ink-line);
  box-shadow: var(--shadow-lg);
}
.admin-modal__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ink-line);
}
.admin-modal__head h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
}
.admin-modal__close {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--ink-line);
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
  transition: background .2s var(--ease);
}
.admin-modal__close:hover { background: var(--ink); color: var(--paper); }
#adminModalForm { padding: 1.5rem; }
#adminModalFields { display: grid; gap: 1rem; }
.admin-modal__actions {
  display: flex; justify-content: flex-end; gap: .6rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink-line);
}

.admin-preview {
  background: var(--paper-cool);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-top: .25rem;
}
.admin-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.admin-upload-btn {
  margin-left: .6rem;
  padding: .25rem .55rem;
  background: transparent;
  border: 1px solid var(--ink-line);
  font-size: .72rem;
  cursor: pointer;
  letter-spacing: .04em;
  vertical-align: middle;
  transition: background .2s var(--ease);
}
.admin-upload-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.admin-gallery-list {
  list-style: none; padding: 0; margin: .25rem 0 0;
  display: grid; gap: .4rem;
}
.admin-gallery-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: .6rem;
  padding: .35rem;
  background: var(--paper-warm);
  border: 1px solid var(--ink-line);
}
.admin-gallery-item img {
  width: 80px; height: 50px;
  object-fit: cover; display: block;
  background: var(--paper-cool);
}
.admin-gallery-id {
  padding: .45rem .6rem;
  border: 1px solid var(--ink-line);
  font-family: ui-monospace, Menlo, monospace;
  font-size: .8rem;
  background: var(--paper);
}
.admin-gallery-actions { display: flex; gap: .25rem; }
.admin-gallery-actions button {
  width: 28px; height: 28px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--ink-line);
  font-size: .85rem;
  cursor: pointer;
  display: grid; place-items: center;
}
.admin-gallery-actions button.danger:hover { background: #a04030; color: var(--paper); border-color: #a04030; }
.admin-gallery-actions button:disabled { opacity: .35; cursor: not-allowed; }

/* --- Portfolio year filter (secondary row) --- */
.ai-tabs--years {
  border-bottom: 1px solid var(--ink-line);
  margin-bottom: 2rem;
}
.ai-tabs--years .ai-tab {
  padding: .7rem 1rem;
  font-size: .82rem;
  letter-spacing: .04em;
}

/* --- Portfolio card: indicate it's clickable to a gallery --- */
.project { cursor: pointer; }
.project::after {
  content: '⌕';
  position: absolute;
  top: 1rem; right: 1rem;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1rem;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  pointer-events: none;
  z-index: 2;
}
.project:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* --- Lightbox modal --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 10, .94);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  animation: lightboxFadeIn .25s var(--ease);
}
.lightbox[hidden] { display: none; }
@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox__stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
}
.lightbox__img {
  max-width: min(100%, 1400px);
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  animation: lightboxImgIn .35s var(--ease);
}
@keyframes lightboxImgIn {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .25);
  color: var(--paper);
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
  display: grid;
  place-items: center;
  z-index: 2;
}
.lightbox__close {
  top: clamp(1rem, 2vw, 1.5rem);
  right: clamp(1rem, 2vw, 1.5rem);
  width: 44px; height: 44px;
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  font-size: 2rem;
  font-family: var(--serif);
  line-height: 1;
}
.lightbox__nav--prev { left: clamp(1rem, 2vw, 1.5rem); }
.lightbox__nav--next { right: clamp(1rem, 2vw, 1.5rem); }

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}
.lightbox__nav--prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox__nav--next:hover { transform: translateY(-50%) translateX(2px); }

.lightbox__caption {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem) .25rem;
  color: rgba(255, 255, 255, .9);
}
.lightbox__cat {
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  display: block;
  margin-bottom: .25rem;
}
.lightbox__title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--paper);
}
.lightbox__count {
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
  white-space: nowrap;
}

.lightbox__thumbs {
  display: flex;
  gap: .5rem;
  padding: .75rem clamp(1rem, 4vw, 3rem) .25rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.3) transparent;
}
.lightbox__thumbs::-webkit-scrollbar { height: 6px; }
.lightbox__thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 3px; }
.lightbox__thumb {
  flex: 0 0 auto;
  width: 70px; height: 50px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .05);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  opacity: .55;
  transition: opacity .2s var(--ease), border-color .2s var(--ease);
}
.lightbox__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.lightbox__thumb.is-active,
.lightbox__thumb:hover { opacity: 1; border-color: var(--paper); }

@media (max-width: 720px) {
  .lightbox__caption { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .lightbox__nav { width: 42px; height: 42px; font-size: 1.6rem; }
  .lightbox__thumb { width: 56px; height: 40px; }
}

/* Lock body scroll when lightbox is open */
body.lightbox-open { overflow: hidden; }

/* --- Privacy policy page --- */
.privacy-doc { display: grid; gap: 3rem; }
.privacy-section { display: grid; gap: .75rem; }
.privacy-section h2 { color: var(--ink); }
.privacy-section h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: .8rem;
}
.privacy-section p { font-size: .95rem; line-height: 1.75; color: var(--ink-soft); }
.privacy-section ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.privacy-section ul li {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--ink-soft);
  padding-left: 1.2rem;
  position: relative;
}
.privacy-section ul li::before {
  content: '·';
  position: absolute;
  left: .3rem;
  color: var(--accent);
  font-weight: bold;
}
.privacy-section strong { color: var(--ink); font-weight: 600; }

.privacy-table {
  width: 100%;
  margin-top: .5rem;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--paper);
}
.privacy-table th, .privacy-table td {
  border: 1px solid var(--ink-line);
  padding: .65rem .85rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}
.privacy-table th {
  background: var(--paper-warm);
  font-weight: 600;
  color: var(--ink);
  font-size: .82rem;
  letter-spacing: .04em;
}
.privacy-table td { color: var(--ink-soft); }

.privacy-card {
  background: var(--paper-warm);
  border: 1px solid var(--ink-line);
  padding: 1.1rem 1.3rem;
  margin-top: .75rem;
  display: grid;
  gap: .35rem;
}
.privacy-card h3 { margin-top: 0; color: var(--ink); font-size: 1rem; font-family: 'Inter', sans-serif; font-weight: 600; letter-spacing: .01em; }
.privacy-card p { margin: 0; font-size: .92rem; }

@media (max-width: 720px) {
  .privacy-doc { gap: 2.25rem; }
  .privacy-table { font-size: .82rem; display: block; overflow-x: auto; white-space: nowrap; }
  .privacy-table td, .privacy-table th { white-space: normal; }
}

/* =========================================================
   RESPONSIVE REFINEMENTS
   Layered breakpoints — each only overrides what changes.
   Targets: small laptop (≤1200), iPad landscape (≤1100),
   iPad portrait (≤880, already triggers mobile nav),
   small tablet (≤720), phone (≤520), small phone (≤380).
   ========================================================= */

/* ----- Small laptops & iPad landscape (≤1200px) -----
   Keep desktop layout but tighten the nav so 7 menu items + CTA
   + lang switch don't crowd the brand mark. */
@media (max-width: 1200px) {
  .nav__menu { gap: 1.35rem; }
  .nav__cta { margin-left: .5rem; padding: .75rem 1.1rem; }
  .lang-switch { margin-left: .65rem; }
  .lang-switch button { padding: .3rem .45rem; }
}

/* ----- iPad portrait & large tablets (≤1100px) -----
   Mobile nav engages here so the menu icon is shown.
   Make the brand subtitle hide so the header doesn't wrap. */
@media (max-width: 1100px) {
  .brand__sub { display: none; }
  .portfolio { gap: 1rem; }
  /* Portfolio: collapse 12-col to a balanced pair on tablets */
  .project--wide { grid-column: span 12; aspect-ratio: 16 / 9; }
  .project--tall { grid-column: span 12; aspect-ratio: 4 / 3; }
}

/* ----- iPad portrait band (≤880px) -----
   Mobile nav drawer is already enabled (existing rule).
   Add stats/sec-head/process tightening that 720px misses. */
@media (max-width: 880px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--ink-line); }
  .stat { padding: 2rem 1.25rem; }

  .sec-head { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2rem; }
  .sec-head__lede { font-size: .98rem; }

  .hero { padding-top: 76px; }
  .hero__inner { padding: 2.25rem 0 3rem; }
  .hero__sub { font-size: 1rem; max-width: 100%; }
  .hero__meta { font-size: .7rem; padding: 1rem 0 1.5rem; }
  .hero__dots { bottom: clamp(4.5rem, 11vh, 6rem); }

  .marquee { padding: .9rem 0; }
  .marquee__track { gap: 2rem; }

  .nav { padding: .85rem 0; }
  .brand__mark { font-size: 1.2rem; }

  .feature { padding: 2rem 1.5rem; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

/* ----- Small tablets (≤720px) ----- */
@media (max-width: 720px) {
  .feature-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .cal-embed { min-height: 260px; }
  #cal-inline-container { min-height: 260px; }
  #cal-inline { height: 540px !important; }
  .page-hero { padding: 9rem 0 3rem; }
  .section { padding: clamp(3rem, 8vw, 6rem) 0; }
}

/* ----- Phones (≤520px) ----- */
@media (max-width: 520px) {
  /* Tighter side gutters give content room to breathe */
  .container,
  .container-narrow { width: min(100% - 2rem, var(--container)); }

  .btn { padding: .8rem 1.25rem; font-size: .82rem; }
  .row { gap: .75rem; }
  .row .btn { flex: 1 1 auto; justify-content: center; }

  .hero { min-height: 92vh; padding-top: 72px; }
  .hero__inner { padding: 1.75rem 0 2.5rem; }
  .hero__inner .container { gap: 1.1rem; }
  .hero__sub { font-size: .95rem; line-height: 1.55; }
  .hero__meta {
    flex-direction: column; align-items: flex-start; gap: .3rem;
    font-size: .65rem; letter-spacing: .15em;
    padding: .85rem 0 1.2rem; margin-top: 1.25rem;
  }
  .hero__meta .container { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .hero__dots { right: 1rem; bottom: clamp(7rem, 14vh, 9rem); gap: .4rem; }
  .hero__dot { width: 20px; }
  .hero__dot.is-active { width: 32px; }

  .marquee__track { font-size: 1.15rem; gap: 1.5rem; }

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

  .page-hero { padding: 8rem 0 2.5rem; }

  /* Forms */
  .field input, .field select, .field textarea { padding: .75rem .9rem; }
  .file-uploader__btn { padding: .85rem 1rem; font-size: .85rem; }
  .consent-row { font-size: .82rem; }

  /* AI chat */
  .chat-window { height: 320px; }
  .chat-input input { padding: .75rem .85rem; }

  /* Stats — single column on very narrow */
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: none !important; border-bottom: 1px solid var(--ink-line); padding: 1.4rem 1rem; }
  .stat:last-child { border-bottom: none; }

  /* Footer condensed */
  .site-footer { padding: 2.75rem 0 1.25rem; }
  .footer-grid { gap: 1.75rem; padding-bottom: 2rem; }
}

/* ----- Small phones (≤380px) -----
   iPhone SE / Galaxy S8 portrait. Avoid horizontal overflow. */
@media (max-width: 380px) {
  body { font-size: 15px; }
  .container,
  .container-narrow { width: min(100% - 1.5rem, var(--container)); }
  .btn { padding: .7rem 1rem; font-size: .78rem; }
  .row { gap: .5rem; }
  .marquee__track { font-size: 1rem; }
  .hero__title { font-size: clamp(2.2rem, 12vw, 3rem); }
  .nav { padding: .7rem 0; }
  .brand__mark { font-size: 1.1rem; }
  .lang-switch button { padding: .25rem .35rem; font-size: .65rem; }
}

/* ----- Landscape phones (short height) -----
   When users rotate a phone, hero shouldn't lock at 100vh. */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { min-height: 100vh; padding-top: 60px; }
  .hero__inner { padding: 1.25rem 0 1.75rem; }
  .hero__dots { bottom: 4.5rem; }
}

/* ----- Touch devices: drop hover-only effects -----
   Hover on touch is sticky; only apply hover styles on real pointers. */
@media (hover: none) {
  .btn:hover { transform: none; }
  .btn:hover .arrow { transform: none; }
  .project:hover img { transform: none; }
  .team-card:hover .team-card__photo { filter: grayscale(1) contrast(1.05); }
}

/* ===========================================================
   PHASE 2 — Conversion components
   (A) Messenger float widget
   (B) Mobile sticky CTA
   (C) FAQ accordion
   (D) Testimonials
   (E) Before/After slider
   =========================================================== */

/* ----- (A) Messenger floating widget ----- */
.msg-widget {
  position: fixed; right: 1.25rem; bottom: 1.25rem;
  z-index: 90; display: flex; flex-direction: column; align-items: flex-end;
  gap: .65rem; pointer-events: none;
}
.msg-widget__list {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: .55rem; transform: scale(.6) translateY(20px);
  opacity: 0; pointer-events: none;
  transition: transform .26s cubic-bezier(.2,.8,.2,1), opacity .2s;
  transform-origin: bottom right;
}
.msg-widget.is-open .msg-widget__list { transform: none; opacity: 1; pointer-events: auto; }
.msg-widget__btn {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .55rem .9rem .55rem .55rem;
  border-radius: 999px; border: 1px solid rgba(0,0,0,.08);
  background: var(--paper); color: var(--ink);
  font-size: .82rem; font-weight: 500; letter-spacing: .02em;
  box-shadow: 0 6px 18px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.06);
  cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.msg-widget__btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.msg-widget__btn .msg-widget__icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; flex: 0 0 32px;
}
.msg-widget__btn--zalo     .msg-widget__icon { background: #0068ff; }
.msg-widget__btn--kakao    .msg-widget__icon { background: #fee500; color: #181600; }
.msg-widget__btn--whatsapp .msg-widget__icon { background: #25d366; }
.msg-widget__btn svg { width: 18px; height: 18px; }
.msg-widget__toggle {
  pointer-events: auto; width: 56px; height: 56px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  border: none; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.10);
  transition: transform .2s cubic-bezier(.2,.8,.2,1);
}
.msg-widget__toggle:hover { transform: scale(1.06); }
.msg-widget__toggle svg { width: 24px; height: 24px; transition: transform .25s; }
.msg-widget.is-open .msg-widget__toggle svg { transform: rotate(45deg); }
@media (max-width: 520px) {
  .msg-widget { right: .85rem; bottom: .85rem; }
  .msg-widget__btn { font-size: .78rem; padding: .5rem .8rem .5rem .5rem; }
}

/* ----- (B) Mobile sticky bottom CTA ----- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: none;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper);
  box-shadow: 0 -6px 24px rgba(0,0,0,.22);
  transform: translateY(110%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sticky-cta.is-visible { transform: none; }
.sticky-cta__inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: .75rem;
}
.sticky-cta__text {
  flex: 1; font-size: .92rem; letter-spacing: .01em;
  display: flex; flex-direction: column; gap: .1rem;
}
.sticky-cta__text strong { font-weight: 600; }
.sticky-cta__text small { font-size: .72rem; color: rgba(255,255,255,.65); }
.sticky-cta__btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--accent); color: var(--ink);
  padding: .65rem 1rem; border-radius: 4px;
  font-size: .82rem; font-weight: 500; text-decoration: none;
  white-space: nowrap;
}
.sticky-cta__close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.7);
  border: none; cursor: pointer; font-size: 1.15rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.sticky-cta__close:hover { background: rgba(255,255,255,.2); color: #fff; }
@media (max-width: 880px) { .sticky-cta { display: block; } }
/* When messenger widget is open, lift its position so it doesn't overlap the CTA */
@media (max-width: 880px) { .msg-widget { bottom: 4.5rem; } }

/* ----- (C) FAQ accordion (native <details>) ----- */
.faq { display: grid; gap: .75rem; max-width: 760px; margin: 2rem auto 0; }
.faq__item {
  border: 1px solid var(--ink-line); border-radius: 4px;
  background: var(--paper);
  transition: box-shadow .2s, border-color .2s;
}
.faq__item[open] { border-color: var(--ink); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.faq__q {
  list-style: none; cursor: pointer;
  padding: 1.1rem 1.3rem; padding-right: 3rem;
  font-size: 1rem; font-weight: 500; color: var(--ink);
  position: relative; line-height: 1.5;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: '+'; position: absolute; right: 1.3rem; top: 50%;
  transform: translateY(-50%); font-size: 1.4rem; font-weight: 300;
  color: var(--ink-mute); transition: transform .25s, color .25s;
}
.faq__item[open] .faq__q::after { transform: translateY(-50%) rotate(45deg); color: var(--ink); }
.faq__a {
  padding: 0 1.3rem 1.2rem; color: var(--ink-mute);
  font-size: .95rem; line-height: 1.65;
}
.faq__a p { margin: .55rem 0; }
.faq__a p:first-child { margin-top: 0; }
.faq__a strong { color: var(--ink); font-weight: 500; }

/* ----- (D) Testimonials ----- */
.testimonials {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 2rem;
}
.testimonial {
  padding: 1.75rem 1.5rem; background: var(--paper);
  border: 1px solid var(--ink-line); border-radius: 4px;
  display: flex; flex-direction: column; gap: 1rem;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.testimonial:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.07); border-color: var(--ink); }
.testimonial__quote {
  font-family: var(--font-serif, 'Cormorant Garamond', 'Noto Serif KR', serif);
  font-size: 1.05rem; line-height: 1.6; color: var(--ink);
  font-style: italic; position: relative; padding-left: 1.25rem;
}
.testimonial__quote::before {
  content: '“'; position: absolute; left: -.25rem; top: -.5rem;
  font-size: 2.5rem; color: var(--accent); line-height: 1; font-style: normal;
}
.testimonial__meta {
  display: flex; align-items: center; gap: .75rem; margin-top: auto;
}
.testimonial__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper-warm); flex: 0 0 40px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 500; color: var(--ink-mute);
  text-transform: uppercase;
}
.testimonial__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.testimonial__name { font-size: .88rem; font-weight: 500; color: var(--ink); line-height: 1.3; }
.testimonial__role { font-size: .75rem; color: var(--ink-mute); margin-top: .15rem; letter-spacing: .03em; }

/* ----- (E) Before / After slider ----- */
.beforeafter {
  position: relative; max-width: 1000px; margin: 2rem auto 0;
  aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px;
  user-select: none; touch-action: none; background: var(--ink);
  cursor: ew-resize;
}
.beforeafter img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none; display: block;
}
.beforeafter__after-wrap {
  position: absolute; inset: 0; width: 50%;
  overflow: hidden; will-change: width;
}
.beforeafter__after-wrap img { width: 100vw; max-width: 1000px; }
.beforeafter__handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px;
  background: rgba(255,255,255,.95); transform: translateX(-50%);
  will-change: left;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2);
}
.beforeafter__knob {
  position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; border-radius: 50%;
  transform: translate(-50%,-50%);
  background: var(--paper); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem; box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.beforeafter__label {
  position: absolute; top: 1rem; padding: .35rem .75rem;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: .72rem; letter-spacing: .15em; text-transform: uppercase;
  border-radius: 2px;
}
.beforeafter__label--before { left: 1rem; }
.beforeafter__label--after  { right: 1rem; }

