:root {
    --bg: #edeae4;
    --bg-panel: #f6f4ef;
    --bg-deep: #221d18;
    --ink: #221d18;
    --ink-soft: #6b6259;
    --ink-faint: #968c7c;
    --on-deep: #ede7db;
    --on-deep-soft: #b7ac98;
    --accent: #8b5a2b;
    --accent-deep: #5c3a1c;
    --accent-on-bg: #fff;
    --line: #ddd6c8;
    --line-strong: #c8bfad;
    --shadow: 0 1px 2px rgba(34,29,24,0.06), 0 10px 30px rgba(34,29,24,0.07);
  }
  :root[data-theme="dark"] {
    --bg: #17140f;
    --bg-panel: #211c15;
    --bg-deep: #0f0c09;
    --ink: #ede7db;
    --ink-soft: #a79c8a;
    --ink-faint: #776c5a;
    --on-deep: #ede7db;
    --on-deep-soft: #b7ac98;
    --accent: #c98a4b;
    --accent-deep: #8b5a2b;
    --accent-on-bg: #17140f;
    --line: #3a3225;
    --line-strong: #4a4030;
    --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 12px 32px rgba(0,0,0,0.4);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #17140f;
      --bg-panel: #211c15;
      --bg-deep: #0f0c09;
      --ink: #ede7db;
      --ink-soft: #a79c8a;
      --ink-faint: #776c5a;
      --on-deep: #ede7db;
      --on-deep-soft: #b7ac98;
      --accent: #c98a4b;
      --accent-deep: #8b5a2b;
      --accent-on-bg: #17140f;
      --line: #3a3225;
      --line-strong: #4a4030;
      --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 12px 32px rgba(0,0,0,0.4);
    }
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  a { color: inherit; }
  img { max-width: 100%; display: block; }
  .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
  }
  .wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
  section { padding: clamp(3rem, 7vw, 5.5rem) 0; }

  h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
  h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }
  .lede { color: var(--ink-soft); font-size: 1rem; max-width: 56ch; }

  /* ---------- Nav ---------- */
  .nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
  }
  .brand { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; }
  .nav-links {
    display: flex;
    gap: 1.6rem;
    font-size: 0.88rem;
    color: var(--ink-soft);
    list-style: none;
    margin: 0; padding: 0;
  }
  .nav-links a:hover { color: var(--accent); }

  .nav-toggle {
    display: none;
    background: none;
    border: 1.5px solid var(--line-strong);
    border-radius: 4px;
    width: 40px;
    height: 36px;
    padding: 0;
    cursor: pointer;
    flex: none;
    align-items: center;
    justify-content: center;
  }
  .nav-toggle span, .nav-toggle::before, .nav-toggle::after {
    content: "";
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    position: relative;
  }
  .nav-toggle::before { margin-bottom: 4px; }
  .nav-toggle::after { margin-top: 4px; }

  @media (max-width: 760px) {
    .nav-row { flex-wrap: wrap; gap: 0.7rem 1rem; }
    .brand { flex: 1 1 auto; }
    .nav-toggle { display: flex; order: 2; }
    .nav-row .btn-primary { order: 3; }
    .nav-links {
      order: 4;
      flex-basis: 100%;
      flex-direction: column;
      gap: 0;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.25s ease;
    }
    .nav-links.open { max-height: 300px; }
    .nav-links li { border-top: 1px solid var(--line); }
    .nav-links a { display: block; padding: 0.85rem 0.2rem; }
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.6em 1.3em;
    border-radius: 3px;
    text-decoration: none;
    white-space: nowrap;
  }
  .btn-primary { background: var(--accent); color: var(--accent-on-bg); }
  .btn-primary:hover { background: var(--accent-deep); }
  .btn-ghost {
    border: 1.5px solid var(--line-strong);
    color: var(--ink);
  }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
  .btn-line {
    border: 1.5px solid var(--accent);
    color: var(--accent);
  }

  /* ---------- Hero ---------- */
  .hero {
    position: relative;
    min-height: min(78vh, 640px);
    display: flex;
    align-items: flex-end;
    background: var(--bg-deep);
    overflow: hidden;
  }
  .hero-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
  }
  .hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,12,9,0.15) 0%, rgba(15,12,9,0.55) 62%, rgba(15,12,9,0.92) 100%);
  }
  .hero-content {
    position: relative;
    color: var(--on-deep);
    padding: 3rem 0 3.5rem;
    width: 100%;
  }
  .hero-content .eyebrow { color: #d9a566; }
  .hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin: 0.4rem 0 0.8rem;
    max-width: 18ch;
  }
  .hero-content p {
    color: var(--on-deep-soft);
    max-width: 52ch;
    font-size: 1.02rem;
  }
  .hero-cta {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 1.6rem;
  }
  .hero-cta .btn-primary { padding: 0.75em 1.6em; font-size: 0.92rem; }
  .hero-cta .btn-ghost { color: var(--on-deep); border-color: rgba(237,231,219,0.4); padding: 0.75em 1.6em; font-size: 0.92rem; }
  .hero-cta .btn-ghost:hover { border-color: var(--on-deep); color: var(--on-deep); }

  /* ---------- Services ---------- */
  .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem;
    margin-top: 2.2rem;
  }
  .service-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1.5rem 1.4rem;
  }
  .service-card .mark {
    width: 2.2rem; height: 2.2rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    margin-bottom: 0.9rem;
    font-size: 0.95rem;
  }
  .service-card h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 0.4rem; }
  .service-card p { color: var(--ink-soft); font-size: 0.87rem; margin: 0; }

  /* ---------- Portfolio ---------- */
  .portfolio { background: var(--bg-panel); }
  .portfolio-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.4rem;
    margin-top: 2.2rem;
  }
  .case-card {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow);
  }
  .case-card img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
  }
  .case-card:hover img { transform: scale(1.05); }
  .case-card .split-photo { display: flex; width: 100%; height: 100%; gap: 2px; }
  .case-card .split-photo img, .case-card .split-photo video { flex: 1; min-width: 0; width: auto; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
  .case-card:hover .split-photo img, .case-card:hover .split-photo video { transform: scale(1.05); }
  .case-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.4rem 1.2rem 1.1rem;
    background: linear-gradient(180deg, transparent, rgba(15,12,9,0.85));
    color: #ede7db;
  }
  .case-overlay .status {
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: #d9a566;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    display: block;
  }
  .case-overlay .name { font-weight: 800; font-size: 1.05rem; }
  .case-overlay .cats { font-size: 0.78rem; color: #cabfa9; margin-top: 0.2rem; }

  /* ---------- FAQ ---------- */
  .faq-list { max-width: 720px; margin-top: 2rem; }
  details {
    border-bottom: 1px solid var(--line);
    padding: 1.1rem 0;
  }
  summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.98rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
  }
  summary::-webkit-details-marker { display: none; }
  summary::after {
    content: "+";
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 400;
    transition: transform 0.2s ease;
  }
  details[open] summary::after { transform: rotate(45deg); }
  details p { color: var(--ink-soft); margin: 0.8rem 0 0; font-size: 0.9rem; max-width: 62ch; }

  /* ---------- Contact ---------- */
  .contact { background: var(--bg-deep); color: var(--on-deep); }
  .contact .eyebrow { color: #d9a566; }
  .contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    margin-top: 2.2rem;
  }
  @media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
  .field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
  }
  .field label { font-size: 0.8rem; color: var(--on-deep-soft); }
  .field input, .field select {
    background: rgba(237,231,219,0.06);
    border: 1px solid rgba(237,231,219,0.25);
    border-radius: 3px;
    padding: 0.65em 0.8em;
    color: var(--on-deep);
    font-size: 0.92rem;
    font-family: inherit;
  }
  .field input::placeholder { color: rgba(237,231,219,0.35); }
  .field-row { display: flex; gap: 0.8rem; }
  .field-row .field { flex: 1; }
  .contact form .btn-primary { width: 100%; justify-content: center; padding: 0.8em; margin-top: 0.4rem; }

  .contact-aside {
    border-left: 1px solid rgba(237,231,219,0.16);
    padding-left: 2rem;
  }
  @media (max-width: 760px) { .contact-aside { border-left: none; padding-left: 0; border-top: 1px solid rgba(237,231,219,0.16); padding-top: 1.6rem; } }
  .contact-aside .item { margin-bottom: 1.5rem; }
  .contact-aside .item .label { font-size: 0.78rem; color: var(--on-deep-soft); margin-bottom: 0.25rem; }
  .contact-aside .item .val { font-size: 1rem; font-weight: 700; }

  .video-feature { background: var(--bg-panel); }
  .video-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    margin-top: 2.2rem;
  }
  @media (max-width: 760px) { .video-showcase { grid-template-columns: 1fr; } }
  .video-showcase .clip {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #000;
  }
  .video-showcase video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 620px;
    object-fit: contain;
  }
  .video-showcase .clip-caption { font-size: 0.8rem; color: var(--ink-faint); margin-top: 0.6rem; text-align: center; }
  .video-showcase .copy h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.6rem; }
  .video-showcase .copy p { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.7; }

  footer.site-footer {
    padding: 2rem 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--ink-faint);
    border-top: 1px solid var(--line);
  }

  /* ---------- Sub-page hero ---------- */
  .page-hero {
    background: var(--bg-deep);
    color: var(--on-deep);
    padding: clamp(2.6rem, 6vw, 4rem) 0;
  }
  .page-hero .eyebrow { color: #d9a566; }
  .page-hero h1 {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 800;
    margin: 0.5rem 0 0.6rem;
  }
  .page-hero p { color: var(--on-deep-soft); max-width: 56ch; font-size: 0.98rem; }

  /* ---------- About page ---------- */
  .story-copy { max-width: 66ch; color: var(--ink-soft); font-size: 0.96rem; line-height: 1.85; }
  .story-copy strong { color: var(--ink); }
  .values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-top: 2.2rem;
  }
  .value-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.6rem 1.5rem;
  }
  .value-card .eyebrow { display: block; margin-bottom: 0.6rem; }
  .value-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; }
  .value-card p { color: var(--ink-soft); font-size: 0.88rem; margin: 0; line-height: 1.7; }

  /* ---------- Services page ---------- */
  .service-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    padding: clamp(2rem, 5vw, 3.2rem) 0;
    border-bottom: 1px solid var(--line);
  }
  .service-detail:last-child { border-bottom: none; }
  .service-detail:nth-child(even) .service-photo { order: 2; }
  @media (max-width: 760px) {
    .service-detail { grid-template-columns: 1fr; }
    .service-detail:nth-child(even) .service-photo { order: 0; }
  }
  .service-photo {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow);
  }
  .service-photo img { width: 100%; height: 100%; object-fit: cover; }
  .service-copy .eyebrow { display: block; margin-bottom: 0.6rem; }
  .service-copy h2 { font-size: 1.3rem; margin-bottom: 0.8rem; }
  .service-copy p { color: var(--ink-soft); font-size: 0.94rem; line-height: 1.75; margin-bottom: 1rem; }
  .service-copy ul { margin: 0 0 1.2rem; padding-left: 1.2em; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.9; }

  .process-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 2.2rem;
    counter-reset: step;
  }
  .process-step {
    flex: 1 1 140px;
    padding: 1.2rem 1.1rem;
    position: relative;
    border-top: 2px solid var(--accent);
  }
  .process-step .num {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    color: var(--accent-soft, var(--accent));
    font-size: 0.75rem;
    font-weight: 700;
  }
  .process-step h4 { font-size: 0.95rem; font-weight: 700; margin: 0.4rem 0 0.3rem; }
  .process-step p { font-size: 0.82rem; color: var(--ink-faint); margin: 0; }

  /* ---------- Portfolio page ---------- */
  .filter-bar { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.8rem; }
  .filter-btn {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5em 1.1em;
    border-radius: 999px;
    border: 1.5px solid var(--line-strong);
    background: none;
    color: var(--ink-soft);
    cursor: pointer;
    font-family: inherit;
  }
  .filter-btn:hover { border-color: var(--accent); color: var(--accent); }
  .filter-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-on-bg); }

  .story-block {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
    align-items: center;
    padding: clamp(2.2rem, 5vw, 3.4rem) 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 80px;
  }
  .story-block:last-child { border-bottom: none; }
  .story-block:nth-child(even) .story-photo { order: 2; }
  @media (max-width: 760px) {
    .story-block { grid-template-columns: 1fr; }
    .story-block:nth-child(even) .story-photo { order: 0; }
  }
  .story-photo {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow);
  }
  .story-photo img, .story-photo video { width: 100%; height: 100%; object-fit: cover; }
  .story-photo.split-photo { display: flex; gap: 2px; }
  .story-photo.split-photo img { flex: 1; min-width: 0; width: auto; }
  .story-copy-block .status {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
  }
  .story-copy-block h3 { font-size: 1.3rem; font-weight: 800; margin: 0.4rem 0 0.6rem; }
  .story-copy-block .cats { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 0.8rem; }
  .story-copy-block p { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.75; }
