:root {
  --bg: #0a0a0b;
  --bg-soft: #101012;
  --surface: #151517;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f1ea;
  --muted: #9b968c;
  --accent: #e8b05a;
  --accent-soft: rgba(232, 176, 90, 0.13);
  --radius: 16px;
  --maxw: 1180px;
  --font: 'Vazirmatn', 'IRANSans', 'Segoe UI', Tahoma, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: -20% 50% auto auto;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(circle at center, rgba(232, 176, 90, 0.16), transparent 62%);
  pointer-events: none;
  z-index: 0;
  filter: blur(10px);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

/* ------------------------------- navigation ------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 40px);
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 11, 0.72);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  white-space: nowrap;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.nav-links {
  display: flex;
  gap: 22px;
  margin-inline-start: auto;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-links a {
  position: relative;
  padding-block: 4px;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-cta {
  font-size: 0.86rem;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.nav-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #12100c;
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
  .nav-cta {
    margin-inline-start: auto;
  }
}

/* --------------------------------- themes --------------------------------- */

html[data-theme='light'] {
  --bg: #ffffff;
  --bg-soft: #f3f9f5;
  --surface: #ffffff;
  --line: rgba(16, 45, 31, 0.1);
  --line-strong: rgba(16, 45, 31, 0.22);
  --text: #10241a;
  --muted: #5f7268;
  --accent: #14875a;
  --accent-soft: rgba(20, 135, 90, 0.12);
}

html[data-theme='light'] .grain {
  opacity: 0.18;
}

html[data-theme='light'] .card-overlay,
html[data-theme='light'] .card:hover .card-overlay,
html[data-theme='light'] .card:focus-visible .card-overlay {
  background: linear-gradient(to top, rgba(23, 20, 15, 0.82), rgba(23, 20, 15, 0.45) 45%, transparent);
}

html[data-theme='light'] .nav {
  background: rgba(255, 255, 255, 0.8);
}

html[data-theme='light'] body::before {
  background: radial-gradient(circle at center, rgba(20, 135, 90, 0.14), transparent 62%);
}

html[data-theme='light'] .btn.primary {
  color: #ffffff;
}

html[data-theme='light'] .nav-cta:hover {
  color: #ffffff;
}

html[data-theme='light'] .card-title,
html[data-theme='light'] .card-cat,
html[data-theme='light'] .card-badge {
  color: #f7f5f0;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.theme-btn {
  font-family: inherit;
  font-weight: 600;
  background: none;
  color: var(--text);
  cursor: pointer;
  min-width: 58px;
}

@media (max-width: 720px) {
  .nav-tools {
    margin-inline-start: auto;
  }
}

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

main {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
}

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 10vw, 128px) clamp(18px, 4vw, 40px) clamp(40px, 6vw, 72px);
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.7rem, 9vw, 6.4rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
  background: linear-gradient(160deg, #fffdf8 25%, #cfc7b6 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 22px 0 0;
  font-size: clamp(1rem, 2.1vw, 1.28rem);
  color: var(--muted);
  max-width: 34ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.2s, color 0.2s, border-color 0.2s;
}

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

.btn.primary {
  background: var(--accent);
  color: #14110b;
  box-shadow: 0 14px 34px -16px rgba(232, 176, 90, 0.8);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

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

.hero-stats {
  display: flex;
  gap: clamp(24px, 6vw, 64px);
  margin: clamp(44px, 8vw, 82px) 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hero-stats dt {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-stats dd {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ------------------------------ profile header ---------------------------- */

.hero.profile {
  display: grid;
  grid-template-columns: clamp(120px, 15vw, 176px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 46px);
  align-items: start;
  padding-top: clamp(44px, 7vw, 92px);
  padding-bottom: clamp(30px, 5vw, 56px);
}

.pf-ring {
  display: block;
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #e8b05a, #f7e3ba, #b4863a, #e8b05a);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

html[data-theme='light'] .pf-ring {
  padding: 5px;
  background: conic-gradient(from 200deg, #0f7d51, #5ce0a0, #b9f5d3, #23a76f, #0f7d51);
  box-shadow: 0 10px 30px -12px rgba(20, 135, 90, 0.55);
}

html[data-theme='light'] .pf-pic {
  background: linear-gradient(150deg, #e8fbf1, #cdf1df);
}

html[data-theme='light'] .pf-initial {
  color: #0f7d51;
}

.pf-pic {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(150deg, #1c1c21, #0d0d0f);
}

.pf-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf-initial {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.pf-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.pf-name {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  gap: 10px;
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.pf-handle {
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--muted);
  direction: ltr;
  unicode-bidi: isolate;
}

.pf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-inline-start: 0;
}

.pf-actions .btn {
  padding: 9px 18px;
  font-size: 0.85rem;
}

.pf-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 4vw, 42px);
  list-style: none;
  margin: 18px 0 0;
  padding: 15px 0 0;
  border-top: 1px solid var(--line);
}

.pf-stats b {
  display: block;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pf-stats span {
  font-size: 0.79rem;
  color: var(--muted);
}

.pf-bio {
  margin-top: 15px;
  max-width: 54ch;
}

.pf-owner {
  margin: 0 0 5px;
  font-weight: 700;
}

.pf-lines p {
  margin: 0 0 4px;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
}

.pf-lines p.strong {
  color: var(--text);
  font-weight: 600;
}

.pf-lines p:last-child {
  margin-bottom: 0;
}

.pf-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 176, 90, 0.35);
  padding-bottom: 1px;
}

/* Instagram-like mobile profile: avatar + stats on top, name, bio, buttons */
@media (max-width: 820px) {
  .hero.profile {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      'avatar stats'
      'name name'
      'bio bio'
      'actions actions';
    column-gap: 14px;
    row-gap: 13px;
    align-items: center;
    text-align: start;
    padding-top: 24px;
  }

  .pf-body,
  .pf-head {
    display: contents;
  }

  .pf-avatar {
    grid-area: avatar;
    width: clamp(86px, 25vw, 100px);
  }

  .pf-stats {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .pf-stats li {
    text-align: center;
    line-height: 1.5;
  }

  .pf-stats b {
    font-size: clamp(0.98rem, 4vw, 1.15rem);
  }

  .pf-stats span {
    font-size: clamp(0.64rem, 2.7vw, 0.78rem);
    display: block;
  }

  .pf-name {
    grid-area: name;
    min-width: 0;
    font-size: clamp(1.3rem, 5.4vw, 1.72rem);
    line-height: 1.35;
    margin-top: 2px;
  }

  .pf-bio {
    grid-area: bio;
    margin: 0;
    max-width: none;
  }

  .pf-lines p {
    font-size: 0.92rem;
  }

  .pf-actions {
    grid-area: actions;
    width: 100%;
    margin: 1px 0 0;
  }

  .pf-actions .btn {
    flex: 1 1 0;
    justify-content: center;
  }
}

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

.works,
.about,
.contact {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 90px) clamp(18px, 4vw, 40px);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.filter {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 0.85rem;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.005em;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease,
    transform 0.18s ease, box-shadow 0.22s ease;
}

.filter:hover {
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.filter:active {
  transform: translateY(0);
}

.filter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter[aria-selected='true'] {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #000));
  border-color: transparent;
  color: #12100c;
  box-shadow: 0 8px 20px -10px var(--accent);
}

.filter[aria-selected='true']:hover {
  transform: translateY(-1px);
}

.filter-count {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.72rem;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  transition: background 0.22s ease, color 0.22s ease;
}

.filter[aria-selected='true'] .filter-count {
  background: rgba(0, 0, 0, 0.16);
  color: inherit;
  opacity: 0.9;
}

html[data-theme='light'] .filter {
  background: #ffffff;
  border-color: rgba(16, 45, 31, 0.14);
  box-shadow: 0 1px 2px rgba(16, 45, 31, 0.04);
}

html[data-theme='light'] .filter:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 8px 18px -12px rgba(16, 45, 31, 0.45);
}

html[data-theme='light'] .filter[aria-selected='true'] {
  background: linear-gradient(135deg, #17a06a, #0c6f49);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 24px -12px rgba(17, 122, 82, 0.75);
}

html[data-theme='light'] .filter-count {
  background: rgba(20, 135, 90, 0.12);
  color: #0f7d51;
}

html[data-theme='light'] .filter[aria-selected='true'] .filter-count {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  opacity: 1;
}

@media (max-width: 600px) {
  .filters {
    gap: 6px;
    margin: 16px 0 20px;
  }
  .filter {
    font-size: 0.78rem;
    padding: 6px 12px;
  }
}

/* Instagram-style tile grid: exactly 3 per row, square tiles */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 980px) {
  .grid {
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .grid {
    gap: 6px;
  }
}

.card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: zoom-in;
  animation: rise 0.5s ease both;
  transition: border-color 0.25s, transform 0.25s;
}

.card:hover,
.card:focus-visible {
  border-color: rgba(232, 176, 90, 0.55);
  transform: translateY(-3px);
  outline: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.3s;
  background: #0e0e10;
}

.card:hover img {
  transform: scale(1.03);
}

/* keep the title/category readable on touch screens without hover */
@media (hover: none) {
  .card-overlay {
    opacity: 1;
    transform: none;
  }
}
/* Instagram-style caption bar on every tile: title + category */
.card-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 52px 14px 12px;
  background: linear-gradient(to top, rgba(6, 6, 7, 0.9), rgba(6, 6, 7, 0.5) 45%, transparent);
  transition: background 0.28s;
}

.card:hover .card-overlay,
.card:focus-visible .card-overlay {
  background: linear-gradient(to top, rgba(6, 6, 7, 0.96), rgba(6, 6, 7, 0.62) 45%, transparent);
}

.card-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-cat {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--accent);
}

.card-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(10, 10, 11, 0.72);
  border: 1px solid rgba(232, 176, 90, 0.45);
  color: var(--accent);
  backdrop-filter: blur(6px);
}

.empty {
  padding: 60px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-sub {
  font-size: 0.86rem;
  opacity: 0.75;
}

.empty a {
  color: var(--accent);
  text-decoration: underline;
}

.skeleton {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #141416 30%, #1c1c20 50%, #141416 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -120% 0;
  }
}

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

.about-body {
  max-width: 62ch;
  margin-top: 26px;
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
  color: #d6d1c7;
  white-space: pre-line;
}

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

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.contact-card:hover {
  border-color: rgba(232, 176, 90, 0.5);
  transform: translateY(-2px);
  background: #131316;
}

.contact-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.1rem;
}

.contact-label {
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.contact-value {
  font-size: 0.95rem;
  direction: ltr;
  text-align: right;
  word-break: break-all;
}

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

.foot {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px clamp(18px, 4vw, 40px) 34px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* the footer speaks the language of the page, one block at a time */
html[lang='en'] .foot-block[lang='fa'],
html:not([lang='en']) .foot-block[lang='en'] {
  display: none;
}

.foot-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.foot-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.85;
}

.foot-legal {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.7;
  opacity: 0.72;
}

.foot-block-en {
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.foot-heart {
  color: var(--accent);
  font-size: 0.9em;
  transform: translateY(0.5px);
}

.foot-sep {
  opacity: 0.5;
}

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

.lang-btn {
  background: none;
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  min-width: 48px;
  cursor: pointer;
}

/* ------------------------------ links sheet ------------------------------ */

.link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.link-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 12px 26px -18px var(--accent);
}

.link-btn:active {
  transform: translateY(0);
}

.link-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.link-btn-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.link-btn-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.link-btn-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.link-btn-label {
  font-weight: 700;
  font-size: 0.98rem;
}

.link-btn-value {
  font-size: 0.82rem;
  color: var(--muted);
  direction: ltr;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn-arrow {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.link-btn:hover .link-btn-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.links-empty {
  margin: 0;
  padding: 18px 4px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.9;
}

html[data-theme='light'] .link-btn {
  background: #ffffff;
  border-color: rgba(16, 45, 31, 0.12);
  box-shadow: 0 1px 2px rgba(16, 45, 31, 0.04);
}

html[data-theme='light'] .link-btn:hover {
  border-color: rgba(20, 135, 90, 0.45);
  box-shadow: 0 16px 30px -22px rgba(16, 45, 31, 0.6);
}

html[data-theme='light'] .link-btn-icon {
  background: linear-gradient(140deg, rgba(20, 135, 90, 0.16), rgba(92, 224, 160, 0.28));
  color: #0f7d51;
}

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

.sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow-y: auto;
  background: var(--bg);
}

.sheet-panel {
  width: 100%;
  max-width: 720px;
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(26px, 6vw, 56px) clamp(18px, 5vw, 40px) 0;
  display: flex;
  flex-direction: column;
}

.sheet-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: clamp(18px, 4vw, 26px);
}

.sheet-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sheet-rule {
  height: 1px;
  background: linear-gradient(to left, var(--accent), transparent 70%);
  opacity: 0.55;
}

.sheet-body {
  flex: 1 1 auto;
}

.sheet-lines p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  line-height: 2.05;
}

.sheet-lines p:last-child {
  margin-bottom: 0;
}

.sheet-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  margin-top: clamp(26px, 6vw, 44px);
  padding: 14px 0 calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 72%, rgba(0, 0, 0, 0));
}

.sheet-foot .btn {
  flex: 1 1 0;
  justify-content: center;
}

.lightbox {
  touch-action: pan-y;
  cursor: grab;
  --text: #f4f1ea;
  --muted: #b6b0a4;
  --line-strong: rgba(244, 241, 234, 0.3);
  --surface: #17171a;
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 8px;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(6, 6, 7, 0.94);
  backdrop-filter: blur(10px);
  animation: fade 0.22s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.lightbox.is-zoomed {
  cursor: grab;
}

.lightbox.is-zoomed.is-dragging {
  cursor: grabbing;
}

.lb-figure {
  touch-action: none;
}

.lb-stage {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 100%;
  min-height: 0;
  will-change: transform;
}


@keyframes lb-out {
  from {
    opacity: 1;
  }
  55% {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.lb-figure img.is-out {
  animation: lb-out 0.24s ease forwards;
}

.lb-ghost {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  /* sized from the shown picture by JS, so it never enters smaller than it will be */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 80px -30px #000;
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}

.lb-figure img {
  -webkit-user-drag: none;
  user-select: none;
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.lb-figure {
  margin: 0;
  display: grid;
  gap: 14px;
  justify-items: center;
  max-height: 100%;
  min-height: 0;
}

.lb-figure img {
  max-height: calc(100vh - 150px);
  max-width: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 80px -30px #000;
}

.lb-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--muted);
}

.lb-figure figcaption strong {
  color: var(--text);
  font-size: 1rem;
}

.lb-nav,
.lb-close {
  font: inherit;
  font-size: 1.6rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(20, 20, 22, 0.8);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.lb-nav:hover,
.lb-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lb-prev {
  justify-self: start;
}

.lb-next {
  justify-self: end;
}

.lb-close {
  position: absolute;
  top: 18px;
  inset-inline-start: 18px;
  font-size: 1.4rem;
  line-height: 1;
}

@media (max-width: 600px) {
  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .lb-figure img {
    max-height: calc(100dvh - 132px);
  }
  /* arrows sit on the picture edges, vertically centred, never under it */
  .lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    font-size: 1.35rem;
    background: rgba(18, 18, 20, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3;
  }
  /* previous work on the right, next on the left, matching the swipe direction */
  .lb-prev {
    right: 10px;
  }
  .lb-next {
    left: 10px;
  }
}

/* Instagram-style gallery on phones: edge-to-edge squares, no captions */
@media (max-width: 820px) {
  .works {
    padding-inline: 0;
    padding-bottom: clamp(18px, 4vw, 28px);
  }

  .foot {
    padding: 20px 16px 16px;
    gap: 6px;
  }

  .works > .section-head,
  .works > .filters {
    padding-inline: clamp(16px, 4vw, 40px);
  }

  .grid {
    gap: 2px;
  }

  .card {
    border: 0;
    border-radius: 0;
  }

  .card:hover,
  .card:focus-visible {
    transform: none;
    border: 0;
  }

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

  .card-overlay,
  .card-badge {
    display: none;
  }

  .empty {
    margin-inline: clamp(16px, 4vw, 40px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
