:root {
  --color-primary: #000102;
  --color-primary-dark: #0d1c32;
  --color-on-primary: #ffffff;
  --color-muted-on-dark: #76859f;
  --color-accent: #0051d5;
  --color-accent-hover: #316bf3;
  --color-text: #1b1b1d;
  --color-text-muted: #44474d;
  --color-bg: #fbf9fb;
  --color-bg-alt: #efedef;
  --color-bg-subtle: #f5f3f5;
  --color-border: #c5c6cd;
  --color-border-strong: #75777e;
  --color-footer-bg: #0a1929;
  --color-overlay-dark: rgba(9, 17, 30, 0.7);
  --color-success: #4ade80;
  --grid-line: rgba(27, 27, 29, .045);
  --grid-size: 48px;

  --font-body: "Pretendard", "Public Sans", system-ui, sans-serif;
  --font-caps: "Pretendard", "Inter", system-ui, sans-serif;

  --container-max: 1440px;
  --container-pad: clamp(20px, 4.5vw, 64px);
  --section-gap: clamp(64px, 8vw, 128px);
  --radius: 0.25rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  word-break: keep-all;
  background-color: var(--color-bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}
.section-alt {
  background-color: var(--color-bg-alt);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}
.hero-editorial {
  background-color: var(--color-bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--container-pad); }

h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 16px; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin: 0 0 24px; }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.4rem); font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 16px; color: var(--color-text-muted); }
.body-lg { font-size: 1.125rem; line-height: 1.7; }
.caps-label {
  font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase;
  font-family: var(--font-caps); font-weight: 700; color: var(--color-border-strong);
  margin: 0 0 8px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; min-height: 44px;
  border-radius: var(--radius); border: none; cursor: pointer;
  font-family: var(--font-caps); text-transform: uppercase; font-size: 12px; font-weight: 700;
  letter-spacing: .03em;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.btn-primary { background: var(--color-primary-dark); color: var(--color-on-primary); }
.btn-primary:hover { background: var(--color-primary); }
.btn-secondary { background: var(--color-accent); color: #fff; }
.btn-secondary:hover { background: var(--color-accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* Urgency bar */
.urgency-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 101; height: 36px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--color-primary-dark); color: #fff;
  font-family: var(--font-caps); font-size: .75rem; letter-spacing: .01em;
  padding: 0 var(--container-pad); text-align: center;
}
.urgency-bar .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--color-success, #4ade80);
  flex-shrink: 0; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Header */
.site-header {
  position: fixed; top: 36px; left: 0; right: 0; z-index: 100;
  background: rgba(251, 249, 251, .8);
  border-bottom: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.site-header.is-scrolled { background: var(--color-bg); border-bottom-color: var(--color-border); }
.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { flex-shrink: 0; border-radius: var(--radius); }
.logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--color-text); }
.logo-tagline {
  font-family: var(--font-caps); font-size: .62rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--color-border-strong); font-weight: 600;
}
.header-cta { flex-shrink: 0; }

main { padding-top: 100px; }

.hero-actions { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

/* Hero motion: slow continuous Ken Burns zoom + staggered entrance reveal (disabled under reduced-motion below) */
@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.1); } }
@keyframes heroRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cardSlideUp { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: translateY(0); } }

/* Scroll-reveal (class added by footer.php script via IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Main-page hero: text column + true full-bleed photo (not a template split-hero: taller, animated, no padding around the photo) */
.hero-editorial {
  display: grid; grid-template-columns: minmax(300px, 440px) 1fr;
  align-items: stretch; min-height: min(760px, 82vh);
}
.hero-editorial-text { display: flex; flex-direction: column; justify-content: center; padding: 48px var(--container-pad); }
.hero-editorial-text h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.03em; }
.hero-editorial-text > * { opacity: 0; animation: heroRise .7s var(--ease) both; }
.hero-editorial-text .caps-label { animation-delay: .05s; }
.hero-editorial-text h1 { animation-delay: .15s; }
.hero-editorial-text p.body-lg { animation-delay: .28s; }
.hero-editorial-text .hero-actions { animation-delay: .4s; }
.hero-editorial-media { position: relative; overflow: hidden; }
.hero-flow-track {
  position: absolute; inset: 0; display: flex; flex-direction: row; height: 100%;
  animation: heroFlow 16s linear infinite;
}
.hero-flow-track img { width: 480px; height: 100%; object-fit: cover; flex-shrink: 0; }
@keyframes heroFlow { from { transform: translateX(-50%); } to { transform: translateX(0%); } }

/* Marquee (used by service-links so growing the list never adds page scroll height) */
.marquee { overflow: hidden; }
.marquee-track { display: flex; gap: 10px; width: max-content; animation: marqueeFlow 26s linear infinite; }
@keyframes marqueeFlow { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Site-photo marquee (continuous strip of misc field photos below the fixed 8-panel portfolio grid) */
.site-marquee { overflow: hidden; margin-top: 40px; }
.site-marquee-track { display: flex; gap: 16px; width: max-content; animation: marqueeFlow 34s linear infinite; }
.site-marquee-track img { width: 220px; height: 280px; object-fit: cover; flex-shrink: 0; filter: grayscale(20%); }

/* Related-pages card grid (detail pages) */
.related-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.related-grid a { border: 1px solid var(--color-border); display: block; background: var(--color-bg-alt); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.related-grid a:hover { border-color: var(--color-accent); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.related-grid .thumb { aspect-ratio: 3/4; overflow: hidden; }
.related-grid img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(35%); transition: transform .7s var(--ease), filter .7s var(--ease); }
.related-grid a:hover img { transform: scale(1.05); filter: grayscale(0%); }
.related-grid h3 { font-size: .92rem; padding: 12px 14px 14px; margin: 0; }

/* Detail-page hero: full-width photo with a solid card cut into the bottom edge (not a gradient wash) */
.hero-tag-media { width: 100%; height: min(760px, 86vh); overflow: hidden; }
.hero-tag-media img { width: 100%; height: 100%; object-fit: cover; display: block; animation: heroZoom 22s ease-in-out infinite alternate; }
.hero-tag-card {
  position: relative; z-index: 2; background: var(--color-primary-dark); color: #fff;
  max-width: 560px; margin: -110px var(--container-pad) 0;
  padding: 40px 40px 44px; box-shadow: 0 28px 52px rgba(9,17,30,.32);
  opacity: 0; animation: cardSlideUp .6s var(--ease) .1s both;
}
.hero-tag-card h1 { color: #fff; }
.hero-tag-card .caps-label { color: rgba(255,255,255,.65); }
.hero-tag-card p.body-lg { color: rgba(255,255,255,.85); }

/* Content split (asymmetric text+image block, used mid-page on detail pages) */
.content-split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.content-split img { display: block; width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; }

/* Sections */
.section { padding: var(--section-gap) 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }

/* Featured grid (2 large + 3 small editorial composition) */
.featured-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px;
}
.featured-service {
  position: relative; overflow: hidden; border: 1px solid var(--color-border);
  grid-column: span 2; display: block; background: var(--color-bg-alt);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.featured-service.featured-large { grid-column: span 3; }
.featured-service.featured-large .thumb { aspect-ratio: 4/3; }
.featured-service .thumb { aspect-ratio: 3/4; overflow: hidden; }
.featured-service img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(40%); transition: transform .7s var(--ease), filter .7s var(--ease); }
.featured-service:hover img { transform: scale(1.05); filter: grayscale(0%); }
.featured-service:hover { border-color: var(--color-accent); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.featured-service .caption { padding: 16px 20px; }
.featured-service .caption p { margin: 0; font-size: .9rem; }

/* Portfolio gallery — uniform card size, no jagged heights */
.portfolio-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.portfolio-grid figure {
  margin: 0; border: 1px solid var(--color-border); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.portfolio-grid figure:hover { border-color: var(--color-accent); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.portfolio-grid .thumb { aspect-ratio: 4/3; overflow: hidden; }
.portfolio-grid img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(35%); transition: transform .7s var(--ease), filter .7s var(--ease); }
.portfolio-grid figure:hover img { transform: scale(1.05); filter: grayscale(0%); }
.portfolio-grid figcaption { padding: 10px 14px; font-size: .85rem; color: var(--color-text-muted); }

/* Site-wide services list (topical hub links) — marquee so a growing list never adds page scroll height */
.service-links a {
  flex-shrink: 0; white-space: nowrap;
  border: 1px solid var(--color-border); padding: 10px 18px; font-size: .9rem; font-weight: 600;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.service-links a:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-bg-alt); }

/* Process */
.process-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; counter-reset: step; }
.process-step { border-top: 2px solid var(--color-primary-dark); padding-top: 16px; }
.process-step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--font-caps); font-weight: 700; color: var(--color-accent); font-size: .8rem; }

/* FAQ (native accordion, no JS) */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--color-border); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--color-accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin-top: 12px; }

/* CTA band */
.cta-band { position: relative; background: var(--color-primary-dark); color: #fff; text-align: left; overflow: hidden; }
.cta-band .cta-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .38; z-index: 0; filter: grayscale(20%);
}
.cta-band::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(100deg, rgba(13,28,50,.92) 22%, rgba(13,28,50,.55) 100%);
}
.cta-band .container { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--color-muted-on-dark); }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-card { border: 1px solid var(--color-border); padding: 32px; background: #fff; }
.info-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.info-row:last-child { border-bottom: none; }

/* Footer */
.site-footer { background: var(--color-footer-bg); color: #cdd6e4; padding: 64px 0 24px; margin-top: var(--section-gap); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-inner .caps-label { color: #7d8ba3; }
.footer-inner a:hover { color: #fff; }
.footer-name { font-weight: 700; font-size: 1.1rem; color: #fff; margin-bottom: 8px; }
.footer-desc { color: #7d8ba3; }
.footer-inner p { color: #cdd6e4; margin: 0 0 6px; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: .8rem; color: #7d8ba3; }

/* Sticky mobile CTA */
.sticky-cta { display: none; }

/* 404 */
.error-page { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }

@media (max-width: 900px) {
  .urgency-bar { font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; gap: 6px; }
  .header-cta { display: none; }
  .hero-editorial { grid-template-columns: 1fr; min-height: 0; }
  .hero-editorial-text { padding-bottom: 24px; }
  .hero-editorial-media { min-height: 320px; }
  .hero-tag-media { height: 320px; }
  .hero-tag-card { max-width: none; margin: -64px 16px 0; padding: 28px 24px 32px; }
  .content-split { grid-template-columns: 1fr; }
  .content-split img { aspect-ratio: 3/2; }
  .featured-grid { grid-template-columns: 1fr 1fr; }
  .featured-service, .featured-service.featured-large { grid-column: span 1; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .sticky-cta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: var(--color-primary-dark);
  }
  .sticky-cta .btn { border-radius: 0; min-height: 56px; }
  main { padding-bottom: 56px; }
}

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