/* =====================================================
   居研室內設計 — Global Design System
   Style: 高級極簡 · 米白石灰 · 材質感 · 留白 · 東方韻味
   ===================================================== */

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Tokens ────────────────────────────────────────── */
:root {
  /* palette */
  --stone:       #F5F2ED;   /* warm off-white base */
  --stone-mid:   #EDE9E3;   /* card backgrounds */
  --stone-dark:  #D8D2C8;   /* borders, dividers */
  --charcoal:    #2B2B28;   /* primary text */
  --charcoal-mid:#4A4A46;   /* secondary text */
  --warm-grey:   #8C8880;   /* muted labels */
  --sand:        #BFB89F;   /* accent line / highlight */
  --terra:       #9B7B5C;   /* warm accent, CTA */
  --terra-light: #C4A882;   /* hover state */
  --ink:         #1A1A18;   /* headings */
  --white:       #FFFFFF;

  /* typography */
  --font-serif:  'Georgia', 'Noto Serif TC', 'Times New Roman', serif;
  --font-sans:   'Helvetica Neue', 'Noto Sans TC', 'PingFang TC', Arial, sans-serif;

  /* spacing */
  --max-w:       1200px;
  --pad:         clamp(1.5rem, 5vw, 4rem);
  --section-py:  clamp(5rem, 10vw, 9rem);
  --gap:         clamp(1.5rem, 3vw, 2.5rem);

  /* motion */
  --ease:        cubic-bezier(.25,.46,.45,.94);
  --dur:         0.6s;
}

/* ── Base ──────────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  background: var(--stone);
  color: var(--charcoal);
  font-size: 1rem;
  line-height: 1.7;
}

h1,h2,h3,h4,h5 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: .02em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.15rem; }

p { color: var(--charcoal-mid); max-width: 68ch; }

/* ── Container ─────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 2rem;
  font-family: var(--font-sans);
  font-size: .875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all .3s var(--ease);
}
.btn-primary {
  background: var(--terra);
  color: var(--white);
}
.btn-primary:hover { background: var(--terra-light); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--charcoal);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--white);
}
.btn-light {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.5);
}
.btn-light:hover {
  background: var(--white);
  color: var(--ink);
}

/* ── Section ───────────────────────────────────────── */
.section { padding: var(--section-py) 0; }
.section-alt { background: var(--stone-mid); }
.section-dark { background: var(--charcoal); color: var(--stone); }
.section-dark h2,
.section-dark h3,
.section-dark h4 { color: var(--stone); }
.section-dark p { color: var(--stone-dark); }

.section-label {
  display: block;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--warm-grey);
  margin-bottom: 1rem;
}
.section-label::before {
  content: '— ';
  color: var(--terra);
}

.section-header {
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.section-header p {
  margin-top: 1rem;
  font-size: 1.05rem;
}

/* ── Divider line ──────────────────────────────────── */
.line-accent {
  width: 3rem;
  height: 1px;
  background: var(--terra);
  margin: 1.5rem 0;
}

/* ── Page Hero ─────────────────────────────────────── */
.page-hero {
  position: relative;
  height: clamp(320px, 55vh, 560px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--charcoal);
}
.page-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .55;
}
.page-hero-content {
  position: relative;
  z-index: 1;
  padding: 0 var(--pad) 4rem;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.page-hero-content .section-label { color: var(--sand); }
.page-hero-content h1 { color: var(--white); }
.page-hero-content p { color: rgba(255,255,255,.7); max-width: 50ch; margin-top: .75rem; }

/* ── Full-viewport Hero ────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,24,.8) 0%, rgba(26,26,24,.15) 60%, transparent 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--pad) clamp(4rem, 8vh, 7rem);
}
.hero-eyebrow {
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 1.25rem;
}
.hero-content h1 {
  color: var(--white);
  font-size: clamp(2.8rem, 6vw, 5rem);
  max-width: 12ch;
}
.hero-content p {
  color: rgba(255,255,255,.72);
  font-size: 1.1rem;
  max-width: 44ch;
  margin-top: 1.25rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  right: var(--pad);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  writing-mode: vertical-rl;
}
.hero-scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 3rem;
  background: rgba(255,255,255,.3);
  margin-top: .5rem;
}

/* ── Intro Split ───────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
.split.reverse { direction: rtl; }
.split.reverse > * { direction: ltr; }

@media (max-width: 768px) {
  .split, .split.reverse { grid-template-columns: 1fr; direction: ltr; }
}

/* ── Cards ─────────────────────────────────────────── */
.cards-grid {
  display: grid;
  gap: 1px;
  background: var(--stone-dark);
}
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .cards-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .cards-3, .cards-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--stone);
  padding: 2.5rem 2rem;
}
.card-dark { background: var(--charcoal-mid); }
.card-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.5rem;
  color: var(--terra);
}
.card h4 { margin-bottom: .75rem; }

/* ── Project Grid ──────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.project-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 768px) {
  .project-grid, .project-grid.cols-3 { grid-template-columns: 1fr; }
}

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--charcoal);
  aspect-ratio: 4/3;
}
.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.project-card:hover img { transform: scale(1.05); }
.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,24,.9) 0%, transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.project-card:hover .project-card-overlay { opacity: 1; }
.project-card-overlay h3 { color: var(--white); font-size: 1.2rem; }
.project-card-overlay p { color: rgba(255,255,255,.7); font-size: .875rem; max-width: unset; }
.project-card-label {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  font-size: .65rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  background: var(--terra);
  color: var(--white);
  padding: .3rem .75rem;
}

/* featured card spans 2 cols */
.project-card.featured {
  grid-column: span 2;
  aspect-ratio: 16/7;
}
@media (max-width: 768px) {
  .project-card.featured { grid-column: span 1; aspect-ratio: 4/3; }
}

/* ── Stats bar ─────────────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--stone-dark);
  border-top: 1px solid var(--stone-dark);
  border-bottom: 1px solid var(--stone-dark);
}
.stat-item {
  background: var(--stone);
  padding: 2.5rem 2rem;
  text-align: center;
}
.stat-item .num {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--ink);
  display: block;
}
.stat-item .label {
  font-size: .8rem;
  letter-spacing: .1em;
  color: var(--warm-grey);
  margin-top: .35rem;
  display: block;
}
@media (max-width: 640px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
}

/* ── Process steps ─────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--stone-dark);
}
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .steps::before { display: none; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
}

.step {
  text-align: center;
  padding: 0 1rem 0;
  position: relative;
}
.step-num {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--stone);
  border: 1px solid var(--stone-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--terra);
  margin: 0 auto 1.5rem;
  position: relative;
  z-index: 1;
}
.step h4 { margin-bottom: .5rem; font-size: 1rem; }
.step p { font-size: .875rem; max-width: unset; }

/* ── Testimonials ──────────────────────────────────── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--stone-dark);
}
@media (max-width: 768px) {
  .testimonials-grid { grid-template-columns: 1fr; }
}
.testimonial {
  background: var(--stone);
  padding: 2.5rem 2rem;
}
.testimonial blockquote {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.7;
  border-left: 2px solid var(--terra);
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}
.testimonial cite {
  font-style: normal;
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--warm-grey);
}

/* ── CTA Banner ────────────────────────────────────── */
.cta-banner {
  position: relative;
  overflow: hidden;
  background: var(--charcoal);
  padding: clamp(5rem, 10vw, 8rem) var(--pad);
  text-align: center;
}
.cta-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .25;
}
.cta-banner-content {
  position: relative;
  z-index: 1;
  max-width: 52ch;
  margin: 0 auto;
}
.cta-banner h2 { color: var(--white); }
.cta-banner p { color: rgba(255,255,255,.65); margin: 1rem auto 2.5rem; }

/* ── Form ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--warm-grey);
  margin-bottom: .5rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .9rem 1rem;
  background: var(--stone-mid);
  border: 1px solid var(--stone-dark);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--terra); }
.form-group textarea { resize: vertical; min-height: 140px; }

/* ── Fade-in ───────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.fade-in.visible { opacity: 1; transform: none; }

/* ── Image ratio helpers ───────────────────────────── */
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.ratio-sq  { aspect-ratio: 1/1; overflow: hidden; }
.ratio-4-3 { aspect-ratio: 4/3; overflow: hidden; }
.ratio-3-4 { aspect-ratio: 3/4; overflow: hidden; }
.ratio-16-9{ aspect-ratio: 16/9; overflow: hidden; }

/* ── Services page ─────────────────────────────────── */
.service-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-bottom: 1px solid var(--stone-dark);
}
.service-row:last-child { border-bottom: none; }
.service-row.reverse { direction: rtl; }
.service-row.reverse > * { direction: ltr; }
@media (max-width: 768px) {
  .service-row, .service-row.reverse { grid-template-columns: 1fr; direction: ltr; }
}

.service-icon {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--terra);
  margin-bottom: 1.5rem;
}
.service-body ul {
  list-style: none;
  margin-top: 1rem;
}
.service-body ul li {
  padding: .4rem 0;
  padding-left: 1.25rem;
  position: relative;
  font-size: .9rem;
  color: var(--charcoal-mid);
}
.service-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--terra);
}

/* ── Sticky subnav ─────────────────────────────────── */
.subnav {
  background: var(--stone-mid);
  border-bottom: 1px solid var(--stone-dark);
  position: sticky;
  top: 0;
  z-index: 90;
}
.subnav ul {
  display: flex;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  overflow-x: auto;
}
.subnav li a {
  display: block;
  padding: 1rem 1.5rem;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--warm-grey);
  border-bottom: 2px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.subnav li a:hover,
.subnav li a.active { color: var(--terra); border-bottom-color: var(--terra); }

/* ── FAQ ───────────────────────────────────────────── */
.faq-list { margin-top: 1rem; }
.faq-item {
  border-bottom: 1px solid var(--stone-dark);
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.5rem 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-q .icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--terra);
  transition: transform .3s;
}
.faq-item.open .faq-q .icon { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
}
.faq-a-inner {
  padding-bottom: 1.5rem;
  color: var(--charcoal-mid);
  font-size: .95rem;
}

/* ── About timeline ────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 3rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: .75rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--stone-dark);
}
.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.625rem;
  top: .35rem;
  width: .75rem;
  height: .75rem;
  border-radius: 50%;
  background: var(--terra);
}
.timeline-year {
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: .5rem;
}
.timeline-item h4 { margin-bottom: .5rem; }

/* ── Team card ─────────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
@media (max-width: 768px) {
  .team-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .team-grid { grid-template-columns: 1fr; }
}
.team-card .team-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.team-card .team-img img { width: 100%; height: 100%; object-fit: cover; }
.team-card .role {
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: .35rem;
  display: block;
}
.team-card h4 { margin-bottom: .5rem; }
.team-card p { font-size: .875rem; }

/* ── Contact ───────────────────────────────────────── */
.contact-split {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--gap);
}
@media (max-width: 768px) {
  .contact-split { grid-template-columns: 1fr; }
}
.contact-info { padding-right: clamp(0rem, 3vw, 3rem); }
.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.contact-info-item svg {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--terra);
  margin-top: .1rem;
}
.contact-info-item dt {
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--warm-grey);
  margin-bottom: .25rem;
}
.contact-info-item dd { color: var(--charcoal); }

/* ── Map area ──────────────────────────────────────── */
.map-wrapper { display: none; } /* legacy, replaced by map-split */
.map-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 480px;
}
@media (max-width: 768px) {
  .map-split { grid-template-columns: 1fr; height: auto; }
  .map-split .map-img { aspect-ratio: 4/3; height: auto; }
  .map-split .map-frame { height: 300px; }
}
.map-img {
  position: relative;
  overflow: hidden;
}
.map-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-frame {
  position: relative;
  overflow: hidden;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-link {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--white);
  color: var(--ink);
  padding: .6rem 1.25rem;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: background .2s;
  text-decoration: none;
}
.map-link:hover { background: var(--stone-mid); }

/* ── Responsive nav (injected by shared.js) ────────── */
@media (max-width: 860px) {
  /* Nav styles handled inline by shared.js */
}
