/* ==========================================================================
   한백하우징 (나무벤치교체) — Stage 5 visual-designer
   brand_tier: standard / industry_mood: utility → sharp corners (radius 0)
   fonts: heading=Wanted Sans, body=Pretendard (no substitution, both CDN-verified)

   Beige check on client.colors.bg #F5F2ED (computed via colorsys, not eyeballed):
     HSV = H 37.5° / S 0.0327 / V 0.9608
     Rule: beige if H 25-60° AND S 0.04-0.35 AND V>=0.78.
     H and V both match the beige band; S (0.0327) sits just under the 0.04 floor —
     technically a hair outside the rule, i.e. already a near-neutral warm off-white,
     not a saturated beige/tan. Given the architect explicitly flagged this value for
     review and the margin is only 0.007, we replace it anyway with a definitively
     cool near-white for safety rather than argue a 3% saturation reading either way.
     --dp-bg is therefore hsl(0 0% 97%) (~#F7F7F7), not #F5F2ED.
   ========================================================================== */

:root {
  /* ---- brand colors (client-provided) ---- */
  --dp-primary: #17140F;      /* HSL 37.5 21% 7.5% */
  --dp-primary-2: #362F23;    /* +10L */
  --dp-primary-3: #554A37;    /* +20L */
  --dp-primary-d: #0B0907;    /* -4L, for hero overlay rgb source */
  --dp-primary-d-rgb: 11, 9, 7;
  --dp-accent: #A67C52;       /* HSL 30 34% 49% */
  --dp-accent-d: #7D5D3E;     /* -12L, hover/active */
  --dp-accent-soft: #C7AA8D;  /* +18L, tints/badges */

  /* ---- backgrounds (bg substituted, see comment above) ---- */
  --dp-bg: hsl(0 0% 97%);       /* replaces beige-adjacent #F5F2ED */
  --dp-bg-soft: hsl(0 0% 95%);
  --dp-bg-warm: #EEEDEC;       /* faint warm-neutral tint, still not beige */
  --dp-bg-dark: var(--dp-primary);

  /* ---- text ---- */
  --dp-text: #1A1A1A;
  --dp-text-sub: #4A4742;
  --dp-text-muted: #7A7670;
  --dp-text-on-dark: #F5F5F4;
  --dp-text-on-dark-sub: #C9C6C1;

  /* ---- borders ---- */
  --dp-border: #DAD9D8;
  --dp-border-soft: #E6E6E5;

  /* ---- radius (utility mood: sharp corners everywhere) ---- */
  --dp-radius: 0px;

  /* ---- spacing scale ---- */
  --dp-space-1: 4px;
  --dp-space-2: 8px;
  --dp-space-3: 12px;
  --dp-space-4: 16px;
  --dp-space-5: 24px;
  --dp-space-6: 32px;
  --dp-space-7: 48px;
  --dp-space-8: 64px;
  --dp-space-9: 96px;
  --dp-space-10: 128px;
  --dp-sec-pad: clamp(56px, 8vw, 96px);
  --dp-gutter: clamp(20px, 4vw, 40px);

  /* ---- typography ---- */
  --dp-font-heading: 'Wanted Sans', 'Pretendard', -apple-system, sans-serif;
  --dp-font-body: 'Pretendard', -apple-system, sans-serif;
  --dp-fs-h1: clamp(2.1rem, 4.8vw, 3.2rem);
  --dp-fs-h2: clamp(1.6rem, 3.2vw, 2.3rem);
  --dp-fs-h3: clamp(1.1rem, 1.8vw, 1.35rem);

  --dp-transition: 0.25s ease;
}

/* ==========================================================================
   Reset / global layout safety
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
img, video, table, pre { max-width: 100%; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--dp-font-body);
  font-size: 19px;
  line-height: 1.7;
  color: var(--dp-text);
  background: var(--dp-bg);
}

h1, h2, h3 {
  font-family: var(--dp-font-heading);
  color: var(--dp-primary);
  line-height: 1.3;
  margin: 0 0 var(--dp-space-4);
}
h1 { font-size: var(--dp-fs-h1); font-weight: 800; }
h2 { font-size: var(--dp-fs-h2); font-weight: 700; }
h3 { font-size: var(--dp-fs-h3); font-weight: 600; }

p { margin: 0 0 var(--dp-space-4); color: var(--dp-text-sub); }

a { color: var(--dp-accent-d); text-decoration-thickness: 1px; }
a:hover { color: var(--dp-accent); }

ul, ol { padding-left: var(--dp-space-5); margin: 0 0 var(--dp-space-4); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--dp-space-6);
  font-size: 0.95em;
}
th, td {
  border: 1px solid var(--dp-border);
  padding: var(--dp-space-3) var(--dp-space-4);
  text-align: left;
}
th { background: var(--dp-bg-soft); color: var(--dp-primary); font-family: var(--dp-font-heading); }

img { display: block; object-fit: cover; }

/* focus visibility everywhere interactive (never remove without replacing) */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--dp-accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Section rhythm — alternating backgrounds
   ========================================================================== */
.dp-section,
section.hero,
section.services-grid,
section.site-showcase,
section.process-timeline,
section.usp-grid,
section.service-area,
section.faq-section,
section.related-section,
section.cta-banner,
section.contact-cards,
section.body-content {
  padding: var(--dp-sec-pad) var(--dp-gutter);
}

/* homepage alternation: hero(dark) > services(soft) > showcase(base) >
   process(warm) > usp(soft) > area(base) > faq(warm) > cta(dark) — never two
   adjacent sections share a background */
.dp-section--soft,
section.services-grid,
section.usp-grid,
section.contact-cards {
  background: var(--dp-bg-soft);
}

.dp-section--warm,
section.process-timeline,
section.faq-section,
section.related-section {
  background: var(--dp-bg-warm);
}

section.site-showcase,
section.service-area,
section.body-content {
  background: var(--dp-bg);
}

article { display: block; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--dp-space-3);
  padding: var(--dp-space-4) var(--dp-gutter);
  background: var(--dp-bg);
  border-bottom: 1px solid var(--dp-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.hdr-logo {
  display: flex;
  align-items: center;
  gap: var(--dp-space-2);
  min-width: 0;
}
.hdr-logo img { flex: none; }
.hdr-logo__name {
  font-family: var(--dp-font-heading);
  font-weight: 800;
  color: var(--dp-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr-logo__tagline {
  color: var(--dp-text-muted);
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 480px) {
  .hdr-logo__tagline { display: none; }
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--dp-space-5);
  background: var(--dp-accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--dp-radius);
  transition: background var(--dp-transition);
}
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { background: var(--dp-accent-d); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
section.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--dp-space-4);
  padding: var(--dp-space-9) var(--dp-gutter);
  color: var(--dp-text-on-dark);
  background-color: var(--dp-primary);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
section.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(98deg,
    rgba(var(--dp-primary-d-rgb), 0.78) 0%,
    rgba(var(--dp-primary-d-rgb), 0.55) 28%,
    rgba(var(--dp-primary-d-rgb), 0.12) 80%);
  z-index: 1;
}
section.hero > * { position: relative; z-index: 2; max-width: 46rem; }
section.hero h1 { color: #fff; }
section.hero p { color: var(--dp-text-on-dark-sub); font-size: 1.05em; }
section.hero .btn-cta { margin-top: var(--dp-space-2); }
section.hero .cta-micro { color: var(--dp-text-on-dark-sub); font-size: 0.85em; margin: var(--dp-space-2) 0 0; }
section.hero p a { color: var(--dp-accent-soft); }
section.hero p a:hover { color: #fff; }
section.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  z-index: 0;
  margin: 0;
}

/* ==========================================================================
   CTA buttons
   ========================================================================== */
.btn-cta,
.contact-phone,
.contact-sms-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 32px;
  background: var(--dp-accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--dp-radius);
  border: 2px solid var(--dp-accent);
  transition: background var(--dp-transition), color var(--dp-transition), transform var(--dp-transition);
}
@media (hover: hover) and (pointer: fine) {
  .btn-cta:hover, .contact-phone:hover, .contact-sms-link:hover {
    background: var(--dp-accent-d);
    border-color: var(--dp-accent-d);
    transform: translateY(-2px);
  }
}
.btn-cta--outline {
  background: transparent;
  color: var(--dp-primary);
  border-color: var(--dp-primary);
}
@media (hover: hover) and (pointer: fine) {
  .btn-cta--outline:hover { background: var(--dp-primary); color: #fff; }
}

/* ==========================================================================
   Service grid / USP grid / cards
   ========================================================================== */
.services-grid ul,
.usp-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--dp-gutter);
}
.services-grid li,
.usp-grid li {
  position: relative;
  border: 1px solid var(--dp-border);
  background: #fff;
  transition: transform var(--dp-transition), box-shadow var(--dp-transition);
}
.services-grid li::before,
.usp-grid li::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--dp-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dp-transition);
}
@media (hover: hover) and (pointer: fine) {
  .services-grid li:hover,
  .usp-grid li:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  }
  .services-grid li:hover::before,
  .usp-grid li:hover::before { transform: scaleX(1); }
}
.services-grid a,
.usp-grid a {
  display: flex;
  flex-direction: column;
  gap: var(--dp-space-2);
  padding: var(--dp-space-6) var(--dp-space-5);
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.services-grid strong,
.usp-grid strong {
  font-family: var(--dp-font-heading);
  font-size: 1.1em;
  color: var(--dp-primary);
}
.services-grid span,
.usp-grid p {
  color: var(--dp-text-sub);
  font-size: 0.9em;
  margin: 0;
}

/* ==========================================================================
   Process timeline
   ========================================================================== */
.process-timeline ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--dp-gutter);
  counter-reset: step;
}
.process-timeline li {
  position: relative;
  padding: var(--dp-space-6) var(--dp-space-4) var(--dp-space-4);
  border-top: 3px solid var(--dp-accent);
  background: var(--dp-bg-soft);
}
.process-timeline li .step-num {
  display: block;
  font-family: var(--dp-font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--dp-accent-soft);
  margin-bottom: var(--dp-space-2);
}
.process-timeline li strong {
  display: block;
  font-family: var(--dp-font-heading);
  color: var(--dp-primary);
  margin-bottom: var(--dp-space-1);
}
.process-timeline li p { margin: 0; color: var(--dp-text-sub); font-size: 0.92em; }

/* ==========================================================================
   Service area (homepage links to regional pages)
   ========================================================================== */
.service-area ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--dp-space-3);
}
.service-area a {
  display: block;
  padding: var(--dp-space-4);
  text-align: center;
  border: 1px solid var(--dp-border);
  color: var(--dp-primary);
  text-decoration: none;
  font-weight: 600;
  transition: background var(--dp-transition), color var(--dp-transition);
}
@media (hover: hover) and (pointer: fine) {
  .service-area a:hover { background: var(--dp-primary); color: #fff; }
}

/* ==========================================================================
   Images — 4:3 only, never portrait/1:1, never fixed px height
   ========================================================================== */
.body-content img,
.related-section img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: 0 0 var(--dp-space-5);
}
.body-content img[width][height] { height: auto; }

/* ==========================================================================
   Marquee (before/after showcase)
   ========================================================================== */
.jgo-marquee {
  overflow-x: hidden;
  width: 100%;
}
.jgo-marquee__track {
  display: flex;
  gap: var(--dp-space-4);
  width: max-content;
  animation: dp-marquee 32s linear infinite;
}
.jgo-marquee__track img {
  width: clamp(200px, 22vw, 320px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  flex: none;
  margin: 0;
}
@keyframes dp-marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* ==========================================================================
   FAQ accordion (h3/p pairs from fs_render_faq — style + JS-toggle, same DOM)
   ========================================================================== */
.faq-item {
  border-bottom: 1px solid var(--dp-border);
  padding: var(--dp-space-4) 0;
}
.faq-item h3 {
  margin: 0;
  cursor: pointer;
  position: relative;
  padding-right: var(--dp-space-6);
  font-size: 1.05em;
}
.faq-item h3::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-family: var(--dp-font-heading);
  color: var(--dp-accent);
  font-size: 1.3em;
  transition: transform var(--dp-transition);
}
.faq-item.is-open h3::after { transform: rotate(45deg); }
.faq-item p {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin: 0;
  transition: max-height var(--dp-transition), opacity var(--dp-transition), margin var(--dp-transition);
}
.faq-item.is-open p {
  max-height: 40em;
  opacity: 1;
  margin-top: var(--dp-space-3);
}
/* no-JS fallback: show everything if JS never attaches is-open toggling */
.no-js .faq-item p { max-height: none; opacity: 1; margin-top: var(--dp-space-3); }

/* ==========================================================================
   Related services / contact cards
   ========================================================================== */
.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--dp-space-3);
}
.related-list a {
  display: inline-flex;
  padding: var(--dp-space-2) var(--dp-space-4);
  border: 1px solid var(--dp-border);
  background: #fff;
  text-decoration: none;
  color: var(--dp-primary);
  font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
  .related-list a:hover { border-color: var(--dp-accent); color: var(--dp-accent-d); }
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--dp-gutter);
}
.contact-card {
  border: 1px solid var(--dp-border);
  background: #fff;
  padding: var(--dp-space-6) var(--dp-space-5);
}
.contact-card ul { list-style: none; padding: 0; margin: 0; color: var(--dp-text-sub); font-size: 0.92em; }
.contact-card li { margin-bottom: var(--dp-space-2); }
.contact-sms-preview { font-size: 0.85em; color: var(--dp-text-muted); margin-top: var(--dp-space-2); }

/* ==========================================================================
   CTA banner
   ========================================================================== */
.cta-banner {
  text-align: center;
  background: var(--dp-primary);
  color: var(--dp-text-on-dark);
}
.cta-banner p { color: var(--dp-text-on-dark-sub); font-size: 1.1em; margin-bottom: var(--dp-space-5); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  display: flex;
  flex-direction: column;
  gap: var(--dp-space-2);
  padding: var(--dp-space-6) var(--dp-gutter);
  background: var(--dp-primary);
  color: var(--dp-text-on-dark-sub);
  font-size: 0.85em;
}
.ft-business { display: flex; gap: var(--dp-space-3); flex-wrap: wrap; color: var(--dp-text-on-dark); }
.ft-business__name { font-family: var(--dp-font-heading); font-weight: 700; }
.ft-nav a { margin-right: var(--dp-space-4); color: var(--dp-text-on-dark-sub); }
.ft-modified { color: var(--dp-text-muted); }

/* ==========================================================================
   Scroll-reveal (IntersectionObserver-driven, see /assets/main.js)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 768px) {
  .services-grid ul,
  .usp-grid ul,
  .process-timeline ol,
  .service-area ul,
  .contact-cards {
    grid-template-columns: 1fr;
  }
  section.hero { min-height: 90vh; }
  .site-nav a { padding: 0 var(--dp-space-4); }
}

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