:root {
  --ink: #17212b;
  --muted: #5c6873;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --accent: #d7663d;
  --accent-dark: #a94427;
  --line: #d9d4c9;
  --nav-height: 76px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }

/* ---------- Skip link (Accessibility) ---------- */
.skip-link {
  position: absolute;
  left: 14px;
  top: -60px;
  z-index: 2000;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: top 0.2s ease;
}
.skip-link:focus, .skip-link:focus-visible { top: 14px; color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Dark mode ---------- */
[data-theme="dark"] {
  --ink: #e9e4da;
  --muted: #a6b0bb;
  --paper: #0f161d;
  --surface: #19222c;
  --accent: #ef8a5f;
  --accent-dark: #f4ab84;
  --line: #2b3845;
}
[data-theme="dark"] body { background: var(--paper); }
[data-theme="dark"] .project-image { mix-blend-mode: normal; }
[data-theme="dark"] .footer { background: #0a1016; color: #c7ced6; }
[data-theme="dark"] .footer a { color: var(--accent); }
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  line-height: 1.6;
}
.navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  min-height: var(--nav-height);
  padding: 14px clamp(18px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(23, 33, 43, 0.97);
  box-shadow: 0 3px 16px rgba(23, 33, 43, 0.18);
}
.logo {
  color: #fffdf8;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
}
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}
.nav-btn {
  color: #f4f1ea;
  padding: 7px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-btn:hover,
.nav-btn:hover,
.nav-btn:focus-visible,
.nav-btn.active { color: #fff; background: var(--accent); }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: 6px;
  border: 1px solid rgba(244, 241, 234, 0.35);
  border-radius: 50%;
  background: transparent;
  color: #f4f1ea;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible { background: var(--accent); border-color: var(--accent); transform: rotate(18deg); }
.lang-toggle {
  margin-left: 6px;
  padding: 0 11px;
  height: 40px;
  border: 1px solid rgba(244, 241, 234, 0.35);
  border-radius: 999px;
  background: transparent;
  color: #f4f1ea;
  font: inherit;
  font-weight: bold;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lang-toggle:hover, .lang-toggle:focus-visible { background: var(--accent); border-color: var(--accent); }
.navbar.is-scrolled { box-shadow: 0 6px 22px rgba(23, 33, 43, 0.28); padding-top: 8px; padding-bottom: 8px; }
.main-content {
  flex: 1;
  width: min(100% - 36px, 1080px);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 56px) 0 72px;
}
.home-content { display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.hero-block { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; padding: 50px 0 80px; }
.hero-block h1 { max-width: 900px; margin-bottom: 34px; }
.hero-block h1 em { color: var(--accent); font-weight: normal; }
.hero-bottomline { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.hero-bottomline .intro { margin: 0; }
.circle-link { display: grid; flex: 0 0 64px; width: 64px; height: 64px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; color: var(--ink); font-size: 2rem; line-height: 1; text-decoration: none; transition: color .2s ease, background-color .2s ease, transform .2s ease; }
.circle-link:hover, .circle-link:focus-visible { color: var(--paper); background: var(--ink); transform: rotate(-12deg); }
.marquee { overflow: hidden; margin: 0 calc((100vw - min(100% - 36px, 1080px)) / -2) 90px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.marquee-track { width: max-content; padding: 14px 0; color: var(--accent-dark); font-size: .82rem; font-weight: bold; letter-spacing: .16em; animation: slide 26s linear infinite; }
.marquee-track span { padding: 0 26px; color: var(--accent); }
@keyframes slide { to { transform: translateX(-50%); } }
.featured-project { margin-bottom: 120px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading .eyebrow { margin: 0; }
.text-link { color: var(--ink); font-size: .9rem; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.project-preview { display: block; color: inherit; text-decoration: none; transition: opacity 0.45s ease; }
.project-preview.is-switching { opacity: 0; }
.project-image-wrap { overflow: hidden; aspect-ratio: 16 / 8; background: var(--surface); }
.project-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; mix-blend-mode: multiply; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.project-preview:hover .project-image, .project-preview:focus-visible .project-image { transform: scale(1.035); }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--ink); }
.project-meta h2 { margin-bottom: 5px; }
.project-meta p { margin: 0; font-size: .9rem; }
.project-arrow { font-size: 2rem; transition: transform .2s ease; }
.project-preview:hover .project-arrow { transform: translate(4px, -4px); }
.closing-line { padding: 70px 0 100px; border-top: 1px solid var(--line); }
.closing-line h2 { margin-bottom: 24px; font-size: clamp(2rem, 5vw, 4rem); }
.page-content { max-width: 820px; }
.case-study { max-width: 1080px; padding-bottom: 110px; }
.case-study h1 { max-width: 920px; margin-bottom: 24px; }
.case-lead { max-width: 760px; margin: 0 0 28px; font-size: clamp(1.2rem, 2.5vw, 1.55rem); }
.case-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-bottom: 90px; }
.case-image { margin: 0 0 70px; border: 1px solid var(--line); background: var(--surface); }
.case-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0 0 70px; }
.case-gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.case-gallery img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; cursor: zoom-in; transition: transform 0.4s cubic-bezier(.2,.8,.2,1); }
.case-gallery img:hover, .case-gallery img:focus-visible { transform: scale(1.03); }
@media (max-width: 680px) { .case-gallery { grid-template-columns: 1fr; } }
.case-image img { display: block; width: 100%; height: auto; }
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 60px; padding: 28px 0 50px; border-top: 1px solid var(--line); }
.case-grid h2 { margin-bottom: 12px; font-size: 1.35rem; }
.case-grid p { max-width: 480px; margin: 0; }
.case-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-top: 22px; border-top: 1px solid var(--ink); }
.case-facts div { display: flex; flex-direction: column; gap: 5px; }
.case-facts span { color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.case-facts strong { font-size: .95rem; }
.status-pill { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .85rem; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; font-family: Georgia, serif; line-height: 1.15; }
h1 { max-width: 760px; margin-bottom: 20px; font-size: clamp(2.4rem, 7vw, 5.4rem); }
h2 { font-size: 1.65rem; }
p { color: var(--muted); }
.intro { max-width: 650px; margin: 0 0 30px; font-size: 1.2rem; }
.button-group { display: flex; flex-wrap: wrap; gap: 12px; }
.btn, .submit-btn {
  display: inline-block;
  border: 2px solid var(--accent);
  border-radius: 4px;
  padding: 10px 18px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn:hover, .btn:focus-visible, .submit-btn:hover, .submit-btn:focus-visible {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  transform: translateY(-2px);
}
.btn-secondary { color: var(--accent-dark); background: transparent; }
.btn-secondary:hover, .btn-secondary:focus-visible { color: #fff; }
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin: 34px 0 48px;
}
.card, .callout { padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.project-card { display: flex; min-height: 310px; flex-direction: column; align-items: flex-start; }
.project-card h2 { margin-bottom: 12px; }
.project-card p:not(.card-number) { margin-top: 0; }
.project-card .text-link { margin-top: auto; }
.card-number { margin: 0 0 34px; color: var(--accent-dark); font-size: .75rem; font-weight: bold; letter-spacing: .1em; text-transform: uppercase; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 22px; }
.tag-list span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .75rem; }
.availability { display: flex; align-items: center; gap: 10px; margin: -4px 0 24px; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #4f9b70; box-shadow: 0 0 0 4px rgba(79, 155, 112, .14); }
.img { display: block; width: 100%; max-width: 400px; height: auto; margin: 16px 0; }
.callout p { margin-top: -10px; }
.contact-form { max-width: 560px; margin: 34px 0 0; display: flex; flex-direction: column; gap: 9px; }
.contact-form label { margin-top: 8px; font-weight: bold; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.honeypot { display: none; }
.submit-btn { align-self: flex-start; margin-top: 10px; }
.footer { flex-shrink: 0; padding: 40px 18px 26px; color: #f4f1ea; background: var(--ink); text-align: center; }
.footer p { margin: 0; color: inherit; font-size: 0.9rem; }
.footer a { color: #f2a27f; }
.footer-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 18px; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(244, 241, 234, 0.28);
  border-radius: 999px;
  color: #f4f1ea;
  font-size: 0.88rem;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.footer-social a:hover,
.footer-social a:focus-visible { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f2a27f;
  font-size: 0.85rem;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.back-to-top:hover, .back-to-top:focus-visible { text-decoration: underline; }

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(.2,.8,.2,1), transform 0.7s cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal][data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal][data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal][data-reveal-delay="3"] { transition-delay: 0.3s; }

/* ---------- Skills ---------- */
.skills { margin: 8px 0 110px; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 48px; margin-top: 26px; }
.skill h3 { margin: 0 0 8px; font-size: 1.05rem; }
.skill-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.skill-bar span { display: block; height: 100%; width: var(--level, 60%); background: var(--accent); border-radius: 999px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.skill-list span { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.8rem; }

/* ---------- About layout ---------- */
.about-grid { display: grid; grid-template-columns: 200px 1fr; align-items: start; gap: 34px; }
@media (max-width: 680px) { .about-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; } .about-photo { margin: 0 auto; } }
.about-photo { width: 200px; height: 200px; object-fit: contain; background: transparent; }

/* ---------- Testimonials ---------- */
.testimonials { margin: 0 0 110px; }
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 26px; }
.testimonial { padding: 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.testimonial blockquote { margin: 0 0 16px; font-family: Georgia, serif; font-size: 1.05rem; line-height: 1.5; }
.testimonial figcaption { font-size: 0.88rem; color: var(--muted); }
.testimonial figcaption strong { color: var(--ink); }

/* ---------- Lightbox ---------- */
.lightbox { max-width: min(92vw, 1100px); width: auto; padding: 0; border: none; background: transparent; }
.lightbox::backdrop { background: rgba(8, 12, 16, 0.82); }
.lightbox img { display: block; width: 100%; height: auto; border-radius: 8px; }
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.92);
  color: #17212b;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 680px) {
  :root { --nav-height: 124px; }
  .navbar { align-items: flex-start; flex-direction: column; gap: 7px; }
  nav { width: 100%; justify-content: flex-start; }
  .nav-btn { padding: 5px 8px; font-size: 0.85rem; }
  .main-content { width: min(100% - 28px, 1080px); padding-top: calc(var(--nav-height) + 34px); }
  .hero-block { min-height: 70vh; padding: 30px 0 55px; }
  .hero-bottomline { align-items: flex-start; flex-direction: column; }
  .circle-link { flex-basis: 54px; width: 54px; height: 54px; }
  .marquee { margin-right: -14px; margin-left: -14px; margin-bottom: 64px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .featured-project { margin-bottom: 72px; }
  .closing-line { padding: 48px 0 70px; }
  .case-study { padding-bottom: 72px; }
  .case-actions { margin-bottom: 58px; }
  .case-grid { grid-template-columns: 1fr; gap: 30px; padding-bottom: 38px; }
  .case-facts { grid-template-columns: 1fr; gap: 16px; }
  h1 { font-size: clamp(2.3rem, 12vw, 3.8rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .marquee-track { animation: slide 40s linear infinite !important; }
}
