:root {
    --cream: #F6F1E6;
    --cream-soft: #FBF8F1;
    --cream-line: #EFE7D6;
    --ink: #3B2A17;
    --ink-2: #C97A2E;
    --ink-soft: rgba(201,122,46,0.10);
    --muted: #7A7163;
    --border: rgba(59,42,23,0.14);
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-sm: 0 4px 18px rgba(59,42,23,0.06);
    --shadow-md: 0 14px 34px rgba(59,42,23,0.10);
  }

  ::selection { background: var(--ink); color: var(--cream); }

  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--cream); }
  ::-webkit-scrollbar-thumb { background: var(--cream-line); border-radius: 100px; border: 2px solid var(--cream); }
  ::-webkit-scrollbar-thumb:hover { background: var(--ink); }
  html { scrollbar-color: var(--cream-line) var(--cream); scrollbar-width: thin; }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
    border-radius: 4px;
  }
  .skip-link {
    position: absolute; left: 16px; top: -60px;
    background: var(--ink); color: var(--cream);
    padding: 10px 18px; border-radius: 8px;
    font-family: var(--font-body); font-weight: 700; font-size: 0.85rem;
    text-decoration: none; z-index: 10000;
    transition: top 0.2s ease;
  }
  .skip-link:focus { top: 16px; }

  #backToTop {
    position: fixed; right: 24px; bottom: 24px; z-index: 500;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--ink); border: none;
    color: var(--cream); font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: var(--shadow-md);
    opacity: 0; pointer-events: none; transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s;
  }
  #backToTop.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
  #backToTop:hover { background: var(--ink-2); }
  @media (max-width: 560px) {
    #backToTop { right: 16px; bottom: 16px; width: 42px; height: 42px; }
  }

  .nav-links a.active { color: var(--ink); }
  .nav-links a.active { border-bottom: 1px solid var(--ink); padding-bottom: 3px; }

  /* ─── NAV ─── */
  nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 48px;
    background: rgba(246,241,230,0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
  .nav-brand svg { width: 30px; height: 30px; flex-shrink: 0; }
  .nav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
  .nav-brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
  .nav-brand-sub { font-family: var(--font-body); font-size: 0.62rem; letter-spacing: 0.18em; color: var(--muted); font-weight: 600; margin-top: 2px; }
  .nav-links { display: flex; gap: 30px; list-style: none; }
  .nav-links a {
    color: var(--muted); text-decoration: none;
    font-size: 0.92rem; font-weight: 500;
    transition: color 0.2s;
    font-family: var(--font-body);
  }
  .nav-links a:hover { color: var(--ink); }

  /* ─── HERO ─── */
  #hero {
    min-height: 100vh; display: flex; align-items: center;
    padding: 140px 48px 90px;
    position: relative; overflow: hidden;
  }
  .hero-scene {
    position: absolute; inset: 0; z-index: 0;
  }
  .hero-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .hero-scene::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(246,241,230,0.92) 0%, rgba(246,241,230,0.6) 40%, rgba(246,241,230,0.22) 65%, rgba(246,241,230,0.05) 100%);
  }
  .hero-content { position: relative; z-index: 1; max-width: 640px; width: 100%; }
  .hero-eyebrow {
    font-family: var(--font-display); font-style: italic; font-weight: 500;
    font-size: 1.5rem; color: var(--ink-2); margin-bottom: 6px;
    animation: fadeUp 0.6s ease both;
  }
  .hero-name {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(2.8rem, 6vw, 4.6rem);
    line-height: 1.08; color: var(--ink);
    letter-spacing: -0.01em;
    animation: fadeUp 0.6s 0.1s ease both;
    text-shadow: 0 2px 24px rgba(246,241,230,0.7);
  }
  .hero-role {
    font-family: var(--font-body); font-weight: 800;
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    color: var(--ink); margin: 18px 0 18px;
    animation: fadeUp 0.6s 0.2s ease both;
  }
  .hero-tagline {
    font-size: 1.02rem; color: #5C5346;
    max-width: 480px; font-weight: 500;
    margin-bottom: 34px;
    animation: fadeUp 0.6s 0.3s ease both;
  }
  .hero-cta {
    display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
    animation: fadeUp 0.6s 0.4s ease both;
  }
  .icon-btn {
    width: 46px; height: 46px; border-radius: 12px;
    background: var(--ink); color: var(--cream);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: transform 0.25s var(--ease), background 0.2s;
    flex-shrink: 0;
  }
  .icon-btn:hover { transform: translateY(-3px); background: var(--ink-2); }
  .icon-btn svg { width: 19px; height: 19px; }
  .btn {
    padding: 14px 26px; border-radius: 12px; font-weight: 700;
    font-family: var(--font-body); font-size: 0.92rem;
    text-decoration: none; transition: transform 0.3s var(--ease), background 0.2s;
    display: inline-block; background: var(--ink); color: var(--cream);
  }
  .btn:hover { transform: translateY(-3px); background: var(--ink-2); }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ─── SECTIONS ─── */
  section { padding: 110px 48px; position: relative; z-index: 1; }
  .section-eyebrow {
    font-family: var(--font-body); font-size: 0.78rem;
    color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase;
    font-weight: 700; margin-bottom: 14px;
  }
  .section-title {
    font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 5vw, 3.4rem);
    line-height: 1.08; margin-bottom: 18px; letter-spacing: -0.01em; color: var(--ink);
  }
  .section-sub { color: var(--muted); max-width: 560px; font-size: 1.02rem; margin-bottom: 56px; }
  .max-w { max-width: 1220px; margin: 0 auto; }

  /* ─── ABOUT ─── */
  #about { background: var(--cream); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .about-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 70px; align-items: center; }
  .about-text p { color: var(--muted); margin-bottom: 20px; font-size: 1.04rem; }
  .about-text p strong { color: var(--ink); font-weight: 700; }
  .about-text a { color: var(--ink); text-decoration: underline; }
  .about-photo-wrap {
    width: 100%; height: 300px; border-radius: 16px; overflow: hidden;
    margin-bottom: 24px; box-shadow: var(--shadow-md); border: 1px solid var(--border);
  }
  .about-photo-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
  .about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .stat-card {
    background: var(--cream-soft); border: 1px solid var(--border);
    border-radius: 14px; padding: 26px 22px; text-align: center;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    box-shadow: var(--shadow-sm);
  }
  .stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
  .stat-num { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; color: var(--ink); line-height: 1; }
  .stat-label { color: var(--muted); font-size: 0.82rem; margin-top: 8px; font-weight: 600; }

  /* ─── DESIGN WORK (technical-art style split cards) ─── */
  #design { background: var(--cream); }
  .design-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .design-card {
    background: var(--cream-soft); border: 1px solid var(--border);
    border-radius: 18px; overflow: hidden;
    display: grid; grid-template-columns: 1fr 1fr;
    min-height: 260px;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    box-shadow: var(--shadow-sm); cursor: pointer;
  }
  .design-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
  .design-info { padding: 34px 30px; display: flex; flex-direction: column; justify-content: center; }
  .design-icon-box {
    width: 46px; height: 46px; border-radius: 12px; background: var(--ink);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px; flex-shrink: 0;
  }
  .design-icon-box svg { width: 22px; height: 22px; color: var(--cream); }
  .design-title { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; margin-bottom: 10px; color: var(--ink); }
  .design-desc { color: var(--muted); font-size: 0.92rem; margin-bottom: 18px; }
  .design-link {
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 700;
    color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  }
  .design-visual {
    position: relative; background: #0D0C0F;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
  }
  .design-visual .mock-doc {
    width: 78%; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px; padding: 16px; font-family: var(--font-body);
  }
  .design-visual .mock-line { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.14); margin-bottom: 10px; }
  .design-visual .mock-line.short { width: 55%; }
  .design-visual .mock-line.accent { background: #E8973F; width: 40%; }
  .design-badge {
    position: absolute; top: 16px; left: 16px;
    background: #d98a4a; color: #fff; font-size: 0.68rem; font-weight: 800;
    letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 12px; border-radius: 100px;
    z-index: 2;
  }
  .design-card.featured-design { grid-column: 1 / -1; }
  @media (max-width: 900px) {
    .design-grid { grid-template-columns: 1fr; }
    .design-card { grid-template-columns: 1fr; }
    .design-visual { min-height: 180px; }
  }

  /* ─── PROJECTS ─── */
  #projects { background: var(--cream); }
  .filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; }
  .filter-pill {
    padding: 9px 20px; border-radius: 100px; font-size: 0.85rem;
    font-family: var(--font-body); font-weight: 600;
    background: var(--cream-soft); color: var(--muted);
    border: 1px solid var(--border); cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
  }
  .filter-pill:hover { border-color: var(--ink); color: var(--ink); }
  .filter-pill.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

  .projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 26px; }
  .project-card {
    background: var(--cream-soft); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-sm);
  }
  .project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
  .project-card.featured { grid-column: 1 / -1; }
  .project-cover {
    height: 190px; display: flex; align-items: center; justify-content: center;
    font-size: 3rem; position: relative; background: var(--card-tint, #ECE4D4);
    color: rgba(59,42,23,0.35);
  }
  .project-cover svg { width: 56px; height: 56px; }
  .project-cover .featured-tag {
    position: absolute; top: 14px; left: 14px; background: var(--ink); color: var(--cream);
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 5px 12px; border-radius: 100px;
  }
  .project-body { padding: 26px 28px; flex: 1; display: flex; flex-direction: column; }
  .project-name { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; margin-bottom: 6px; color: var(--ink); }
  .project-type {
    font-family: var(--font-body); font-size: 0.72rem; letter-spacing: 0.1em;
    text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 14px; display: block;
  }
  .project-role { font-size: 0.8rem; color: var(--ink-2); font-weight: 700; margin-bottom: 12px; }
  .project-desc { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }
  .project-feature-list {
    list-style: none; margin: 0 0 18px; padding: 0;
    display: flex; flex-direction: column; gap: 10px;
  }
  .project-feature-list li {
    position: relative; padding-left: 18px;
    font-size: 0.86rem; line-height: 1.55; color: var(--muted);
  }
  .project-feature-list li::before {
    content: ""; position: absolute; left: 0; top: 0.55em;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--ink);
  }
  .project-feature-list li strong { color: var(--ink); font-weight: 700; }
  .project-highlight {
    background: var(--cream); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 18px;
    font-size: 0.85rem; color: var(--ink); font-weight: 600;
    border-left: 3px solid var(--ink);
  }
  .project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
  .ptag {
    padding: 4px 12px; border-radius: 100px; font-size: 0.75rem;
    font-family: var(--font-body); font-weight: 700;
    background: var(--cream); color: var(--muted);
    border: 1px solid var(--border);
  }
  .project-links { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
  .project-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 18px; border-radius: 10px; font-weight: 700; font-size: 0.86rem;
    text-decoration: none; transition: transform 0.2s, opacity 0.2s;
    background: var(--ink); color: var(--cream);
  }
  .project-link:hover { transform: translateY(-2px); }
  .project-link.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
  .project-link.disabled { background: var(--cream-line); color: var(--muted); cursor: not-allowed; }
  .project-link.disabled:hover { transform: none; }

  .skb-docs { margin-top: 4px; padding-top: 18px; border-top: 1px dashed var(--border); margin-bottom: 18px; }
  .skb-docs-label { font-weight: 800; font-size: 0.85rem; color: var(--ink); margin-bottom: 4px; }
  .skb-docs-sub { color: var(--muted); font-size: 0.82rem; margin-bottom: 14px; }
  .skb-docs-grid { display: flex; flex-direction: column; gap: 8px; }
  .doc-pill {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--cream); border: 1px solid var(--border); border-radius: 10px;
    cursor: pointer; transition: border-color 0.2s;
  }
  .doc-pill:hover { border-color: var(--ink); }
  .doc-pill-icon { display: flex; flex-shrink: 0; }
  .doc-pill-icon svg { width: 18px; height: 18px; color: var(--ink); }
  .doc-pill-text { display: flex; flex-direction: column; flex: 1; }
  .doc-pill-title { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
  .doc-pill-sub { font-size: 0.72rem; color: var(--muted); }
  .doc-pill-action { font-size: 0.72rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }

  .video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0D0C0F; cursor: pointer; overflow: hidden; }
  .video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; display: block; }
  .video-placeholder { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
  .play-btn {
    width: 56px; height: 56px; border-radius: 50%; border: 2px solid;
    display: flex; align-items: center; justify-content: center;
  }
  .play-btn svg { width: 20px; height: 20px; margin-left: 3px; }
  .video-label { font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; }
  .no-video { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 8px; color: rgba(255,255,255,0.5); font-size: 0.85rem; }
  .nv-icon svg { width: 26px; height: 26px; }

  /* ─── TOOLS ─── */
  #tools { background: var(--cream); }
  .tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .tool-card {
    background: var(--cream-soft); border: 1px solid var(--border);
    border-radius: 14px; padding: 24px 20px; text-align: center;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    box-shadow: var(--shadow-sm);
  }
  .tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
  .tool-icon { width: 32px; height: 32px; margin: 0 auto 12px; display: block; color: var(--ink-2); }
  .tool-name { font-weight: 800; font-size: 0.95rem; color: var(--ink); }
  .tool-cat { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

  /* ─── CONTACT ─── */
  #contact { background: var(--cream); padding: 0; }
  .contact-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 640px; }
  .contact-scene { position: relative; overflow: hidden; }
  .contact-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .contact-info { padding: 110px 64px; display: flex; flex-direction: column; justify-content: center; }
  .contact-heading { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 4vw, 3rem); color: var(--ink); margin-bottom: 18px; }
  .contact-info > p { color: var(--muted); font-size: 1.02rem; margin-bottom: 40px; max-width: 420px; }
  .contact-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; font-size: 1.02rem; color: var(--ink); font-weight: 600; }
  .contact-row svg { width: 20px; height: 20px; color: var(--ink-2); flex-shrink: 0; }
  .contact-row a { color: var(--ink); text-decoration: none; }
  .contact-row a:hover { text-decoration: underline; }
  .contact-socials { display: flex; gap: 12px; margin-top: 30px; }
  @media (max-width: 860px) {
    .contact-split { grid-template-columns: 1fr; }
    .contact-scene { min-height: 300px; }
    .contact-info { padding: 64px 32px; }
  }

  /* ─── FOOTER ─── */
  footer {
    background: var(--cream); text-align: center;
    padding: 32px 40px; color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
  }
  footer strong { color: var(--ink); }

  /* ─── SCROLL REVEAL ─── */
  .reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.visible { opacity: 1; transform: translateY(0); }

  /* ─── RESPONSIVE ─── */
  @media (max-width: 768px) {
    nav { padding: 16px 20px; }
    section { padding: 70px 20px; }
    #hero { padding: 110px 20px 60px; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .projects-grid { grid-template-columns: 1fr; }
  }

  @media (min-width: 561px) {
    .hamburger { display: none; }
  }

  @media (max-width: 560px) {
    .hamburger {
      display: flex; flex-direction: column; justify-content: center;
      gap: 5px; background: none; border: none;
      cursor: pointer; padding: 6px;
      position: relative; z-index: 9999;
    }
    .hamburger span {
      display: block; width: 24px; height: 2px;
      background: var(--ink); border-radius: 2px;
      transition: transform 0.3s, opacity 0.3s;
    }
    .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .hamburger.open span:nth-child(2) { opacity: 0; }
    .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .nav-links {
      display: none;
      list-style: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 32px;
      position: fixed;
      top: 0; left: 0;
      width: 100vw; height: 100vh;
      background: var(--cream);
      z-index: 9000;
      padding: 0; margin: 0;
    }
    .nav-links.open { display: flex; }
    .nav-links a { font-size: 1.4rem; color: var(--ink); font-weight: 700; }
  }

  /* accent tint per project card cover */
  .t-yellow { --card-tint: #F3E6C7; }
  .t-orange { --card-tint: #F0DFCB; }
  .t-green  { --card-tint: #E9E2C9; }
  .t-pink   { --card-tint: #F1DCE0; }
  .t-purple { --card-tint: #E3DCEF; }
