/* ============================================================
   ARK STUDIO — ai-zome (Japanese indigo) × kin (gold)
   Display: old-style serif · Body: JP-friendly sans
   ============================================================ */

:root {
  /* light — indigo ink on cool washi paper */
  --bg:            #F2F3F5;
  --bg-raised:     #FCFCFB;
  --bg-tint:       #E9EBEF;
  --ink:           #1D2434;
  --ink-soft:      #4C566B;
  --line:          #D5DAE2;
  --accent:        #A9761C;
  --accent-strong: #7E5710;
  --accent-soft:   rgba(169, 118, 28, 0.12);
  --accent-contrast: #FFFFFF;
  --indigo-deep:   #232F4E;
  --shadow:        0 1px 2px rgba(29, 36, 52, 0.06), 0 8px 24px rgba(29, 36, 52, 0.07);

  --font-display: "Palatino Linotype", Palatino, "Iowan Old Style", Georgia,
                  "Yu Mincho", "Hiragino Mincho ProN",
                  "Leelawadee UI", "Noto Sans Thai", serif;
  --font-body: "Segoe UI", "Leelawadee UI", "Noto Sans Thai",
               "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
               -apple-system, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #101527;
    --bg-raised:     #171E35;
    --bg-tint:       #131A2E;
    --ink:           #ECE8DC;
    --ink-soft:      #A4ABBE;
    --line:          #2A3450;
    --accent:        #DFAB4B;
    --accent-strong: #EFC46E;
    --accent-soft:   rgba(223, 171, 75, 0.14);
  --accent-contrast: #101527;
    --indigo-deep:   #0B0F1E;
    --shadow:        0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="light"] {
  --bg:            #F2F3F5;
  --bg-raised:     #FCFCFB;
  --bg-tint:       #E9EBEF;
  --ink:           #1D2434;
  --ink-soft:      #4C566B;
  --line:          #D5DAE2;
  --accent:        #A9761C;
  --accent-strong: #7E5710;
  --accent-soft:   rgba(169, 118, 28, 0.12);
  --accent-contrast: #FFFFFF;
  --indigo-deep:   #232F4E;
  --shadow:        0 1px 2px rgba(29, 36, 52, 0.06), 0 8px 24px rgba(29, 36, 52, 0.07);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:            #101527;
  --bg-raised:     #171E35;
  --bg-tint:       #131A2E;
  --ink:           #ECE8DC;
  --ink-soft:      #A4ABBE;
  --line:          #2A3450;
  --accent:        #DFAB4B;
  --accent-strong: #EFC46E;
  --accent-soft:   rgba(223, 171, 75, 0.14);
  --accent-contrast: #101527;
  --indigo-deep:   #0B0F1E;
  --shadow:        0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* ---------- base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }

img { max-width: 100%; }

a { color: var(--accent-strong); }

::selection { background: var(--accent); color: var(--accent-contrast); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- eyebrow ---------- */

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  gap: 0.75em;
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
}

.nav-menu a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-menu a:hover { color: var(--ink); }

.nav-menu a.is-active { color: var(--accent-strong); }

.nav-cta {
  color: var(--accent-strong) !important;
  border: 1px solid var(--accent);
  padding: 0.35em 1em;
  border-radius: 2px;
}

.nav-cta:hover { background: var(--accent-soft); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--ink);
}

.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before { position: absolute; top: -5px; }
.nav-toggle-bar::after  { position: absolute; top: 5px; }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.lang-toggle {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.3em 0.8em;
  cursor: pointer;
  min-width: 3.2em;
}

.lang-toggle:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.theme-toggle-icon {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
  border: 1.5px solid var(--ink);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(42rem 22rem at -8% 110%, rgba(35, 47, 78, 0.14), transparent 65%),
    linear-gradient(180deg, var(--bg-tint), var(--bg));
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-scroll {
  position: absolute;
  right: 1.6rem;
  bottom: 1.4rem;
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-scroll::after {
  content: "";
  width: 1px;
  height: 3rem;
  background: linear-gradient(var(--accent), transparent);
}

@media (max-width: 52rem) {
  .hero-scroll { display: none; }
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-monkey {
  position: absolute;
  right: clamp(0rem, 4vw, 3.5rem);
  top: clamp(4rem, 12vh, 7.5rem);
  width: clamp(13rem, 24vw, 22rem);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 12px 24px rgba(11, 15, 30, 0.25));
  animation: monkey-drift 7s ease-in-out infinite;
}

@keyframes monkey-drift {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-18px) rotate(2.5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-monkey { animation: none; }
}

@media (max-width: 64rem) {
  .hero-monkey {
    position: static;
    display: block;
    width: min(14rem, 55vw);
    margin: 2.5rem auto 0;
  }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(4.5rem, 10vh, 8rem) 1.5rem 3.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6.5vw, 4.6rem);
  margin: 1.2rem 0 1.4rem;
  max-width: 16ch;
}

.hero-lede {
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

.hero-stats {
  position: relative;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  max-width: 72rem;
  margin-inline: auto;
  padding: 0 1.5rem 3rem;
}

.hero-stats li {
  display: grid;
  gap: 0.1rem;
}

.hero-stats strong {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-plus { color: var(--accent); }

.hero-stats span:not(.stat-plus) {
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 0.75em 1.7em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow);
}

.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: var(--bg-raised);
}

.btn-ghost:hover { border-color: var(--accent); }

/* ---------- sections ---------- */

.section {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(3.5rem, 8vh, 6rem) 1.5rem;
}

.section-tint {
  max-width: none;
  background: var(--bg-tint);
  border-block: 1px solid var(--line);
}

.section-tint > * {
  max-width: 69rem;
  margin-inline: auto;
}

.section-head {
  margin-bottom: 2.6rem;
  display: grid;
  gap: 0.9rem;
}

.section-note {
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 46rem;
}

/* reveal on scroll (stagger delay set per card in JS) */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms cubic-bezier(0.22, 0.8, 0.3, 1),
              transform 600ms cubic-bezier(0.22, 0.8, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* hero entrance sequence on page load */
.hero-inner > * {
  opacity: 0;
  transform: translateY(18px);
  animation: hero-rise 650ms cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
}

.hero-inner > *:nth-child(1) { animation-delay: 80ms; }
.hero-inner > *:nth-child(2) { animation-delay: 200ms; }
.hero-inner > *:nth-child(3) { animation-delay: 320ms; }
.hero-inner > *:nth-child(4) { animation-delay: 440ms; }

.hero-inner .hero-monkey {
  transform: none;
  animation: hero-fade 900ms ease 550ms forwards,
             monkey-drift 7s ease-in-out 1.45s infinite;
}

.hero-stats li {
  opacity: 0;
  animation: hero-rise 650ms cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
}

.hero-stats li:nth-child(1) { animation-delay: 620ms; }
.hero-stats li:nth-child(2) { animation-delay: 730ms; }
.hero-stats li:nth-child(3) { animation-delay: 840ms; }

@keyframes hero-rise { to { opacity: 1; transform: none; } }
@keyframes hero-fade { to { opacity: 1; } }

/* language switch cross-fade (class set on <html> by JS) */
main, .site-footer { transition: opacity 200ms ease; }

.lang-switching main,
.lang-switching .site-footer { opacity: 0.15; }

/* theme switch cross-fade (temporary class set on <html> by JS) */
.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition: background-color 350ms ease, color 350ms ease,
              border-color 350ms ease, box-shadow 350ms ease !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
  .hero-inner > *, .hero-stats li { animation: none; opacity: 1; transform: none; }
  .hero-inner .hero-monkey { animation: none; }
  main, .site-footer { transition: none; }
  .service-card, .client-wall li, .to-top { transition: none; }
  .service-card:hover, .client-wall li:hover { transform: none; }
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.45;
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem;
  text-wrap: balance;
}

.about-body {
  display: grid;
  gap: 1rem;
  color: var(--ink-soft);
  max-width: 58ch;
}

/* ---------- services ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.2rem;
}

.service-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.8rem;
  align-content: start;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(29, 36, 52, 0.08), 0 16px 36px rgba(29, 36, 52, 0.14);
}

.service-banner {
  width: 100%;
  height: auto; /* override the height attribute so aspect-ratio wins */
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 2px;
}

.service-card h3 {
  font-size: 1.2rem;
}

.service-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.tag-list li {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15em 0.75em;
  white-space: nowrap;
}

/* ---------- process ---------- */

.process-list {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem 1.5rem;
}

.process-list li {
  counter-increment: step;
  position: relative;
  padding-top: 3.2rem;
  border-top: 1px solid var(--line);
}

.process-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0.9rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.process-list h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.process-list p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- works ---------- */

.works-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35em 1.1em;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.filter-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.work-card.is-hidden { display: none; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.2rem;
}

.work-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow);
  color: #F4EFE2;
}

.work-card { background: var(--indigo-deep); }

.work-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.work-card:hover img { transform: scale(1.04); }

@media (prefers-reduced-motion: reduce) {
  .work-card img { transition: none; }
  .work-card:hover img { transform: none; }
}

.work-link {
  position: absolute;
  inset: 0;
  display: block;
}

.work-card figcaption {
  pointer-events: none;
  position: relative;
  width: 100%;
  padding: 2.2rem 1.1rem 0.9rem;
  background: linear-gradient(transparent, rgba(11, 15, 30, 0.85));
  display: grid;
  font-size: 0.95rem;
  font-weight: 600;
}

.work-card figcaption span {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #DFAB4B;
}

/* ---------- works nizima link ---------- */

.works-nizima {
  margin-top: 1.8rem;
  font-size: 0.95rem;
}

.works-nizima a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ---------- clients ---------- */

.client-wall {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1rem;
}

.client-wall li {
  border: 1px solid var(--line);
  background: #FFFFFF; /* logos need a light ground in both themes */
  border-radius: 2px;
  padding: 1.1rem 1.6rem;
  flex: 1 1 12rem;
  min-height: 5.5rem;
  display: grid;
  place-items: center;
  transition: border-color 150ms ease, transform 150ms ease;
}

.client-wall li:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.client-wall img {
  height: 2.6rem;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

/* ---------- contact ---------- */

.section-contact {
  max-width: none;
  background: var(--indigo-deep);
  border-top: 1px solid var(--line);
}

.contact-grid {
  max-width: 72rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: clamp(2rem, 5vw, 5rem);
  color: #ECE8DC;
}

.contact-copy { display: grid; gap: 1.1rem; align-content: start; }

.contact-copy .eyebrow { color: #DFAB4B; }
.contact-copy .eyebrow::before { background: #DFAB4B; }
.contact-copy .eyebrow-jp { color: #A4ABBE; }

.contact-copy p { color: #B9BFCF; max-width: 44ch; }

.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  color: #EFC46E;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.contact-address {
  font-style: normal;
  display: grid;
  gap: 1rem;
  margin-top: 0.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.contact-address p {
  display: grid;
  gap: 0.2rem;
  max-width: none;
}

.contact-address strong {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #DFAB4B;
}

.contact-address span { color: #B9BFCF; line-height: 1.6; }

.contact-address a {
  color: #ECE8DC;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  justify-self: start;
}

.contact-map {
  max-width: 72rem;
  margin: clamp(2rem, 5vh, 3.5rem) auto 0;
}

.contact-map iframe {
  display: block;
  width: 100%;
  height: clamp(18rem, 45vw, 26rem);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  filter: grayscale(0.25) contrast(1.02);
}

.contact-form {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.contact-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #B9BFCF;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 0.98rem;
  color: #ECE8DC;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  padding: 0.65em 0.85em;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #7E869C; }

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid #DFAB4B;
  outline-offset: 1px;
}

.contact-form .btn-primary {
  justify-self: start;
  background: #DFAB4B;
  color: #0B0F1E;
}

.contact-form .btn-primary:hover { background: #EFC46E; }

.section-contact .contact-grid {
  padding: 0;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--indigo-deep);
  color: #7E869C;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.8rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  font-size: 0.85rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #ECE8DC;
}

/* ---------- back to top ---------- */

.to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 60;
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 2px;
  text-decoration: none;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 250ms ease, transform 250ms ease, background 150ms ease;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.to-top:hover { background: var(--accent-strong); }

/* ---------- works lightbox ---------- */

.work-card { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: rgba(11, 15, 30, 0.9);
  backdrop-filter: blur(6px);
}

.lightbox[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .lightbox { animation: lightbox-fade 200ms ease; }
}

@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-img {
  max-width: min(100%, 72rem);
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

.lightbox-caption {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #DFAB4B;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  color: #ECE8DC;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-close:hover {
  color: #DFAB4B;
  border-color: #DFAB4B;
}

/* ---------- responsive ---------- */

@media (max-width: 52rem) {
  .nav-toggle { display: block; }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }

  .nav-menu.is-open { display: flex; }

  .nav-menu li { border-top: 1px solid var(--line); }

  .nav-menu a {
    display: block;
    padding: 0.9rem 1.5rem;
  }

  .nav-cta {
    border: none;
    border-radius: 0;
  }

  .nav-menu li:last-child { padding: 0.9rem 1.5rem; }

  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }
}
