/* ==========================================================================
   Afak Design Studio — shared stylesheet
   Loaded by the homepage and every project detail page.
   ========================================================================== */

:root {
  --ink: #12100e;
  --ink-soft: #1a1815;
  --paper: #f4f1ec;
  --paper-dim: #ddd7cd;
  --muted: #8a8378;
  --accent: #c8613c;
  --line: rgba(244, 241, 236, 0.14);
  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --section-y: clamp(4.5rem, 11vw, 9rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}

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

.wrap { max-width: 78rem; margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #a94f2f; }
.btn--ghost { border-color: rgba(244, 241, 236, 0.35); color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper); background: rgba(244, 241, 236, 0.08); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 16, 14, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.logo img { height: 30px; width: auto; }
.logo__text {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
.logo__text small {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin-top: 0.25rem;
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.25rem); }
.nav a { font-size: 0.9rem; text-decoration: none; color: var(--paper-dim); }
.nav a:hover { color: var(--accent); }
.nav .btn { color: #fff; }
@media (max-width: 46rem) { .nav__links { display: none !important; } }

/* ---------- hero (homepage) ---------- */

.hero { position: relative; min-height: min(88vh, 46rem); display: flex; align-items: flex-end; }
.hero__bg { position: absolute; inset: 0; overflow: hidden; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18,16,14,0.72) 0%, rgba(18,16,14,0.58) 35%, rgba(18,16,14,0.95) 100%);
}
.hero__inner { position: relative; z-index: 1; width: 100%; padding-block: clamp(3rem, 8vw, 6rem); }
/* muted grey is unreadable over the render; lift to full paper on the hero only */
.hero .eyebrow { color: var(--paper); }
.hero__lede { text-shadow: 0 1px 12px rgba(18, 16, 14, 0.5); }
.hero h1 { font-size: clamp(2.5rem, 6.6vw, 5rem); max-width: 17ch; margin-bottom: 1.5rem; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero__lede {
  max-width: var(--measure);
  color: var(--paper-dim);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  margin: 0 0 2.25rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* ---------- proof strip ---------- */

.proof { border-block: 1px solid var(--line); padding-block: 1.4rem; background: var(--ink-soft); }
.proof__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem clamp(1.25rem, 4vw, 3rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--paper-dim);
}
.proof__list li::before { content: "\2713"; color: var(--accent); margin-right: 0.5rem; }

/* ---------- generic section ---------- */

.section { padding-block: var(--section-y); border-bottom: 1px solid var(--line); }
.section__head { display: grid; gap: 1.5rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
@media (min-width: 60rem) {
  .section__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 3rem; }
}
.section__title { font-size: clamp(2rem, 4.4vw, 3.25rem); max-width: 16ch; }
.section__note { color: var(--paper-dim); max-width: var(--measure); margin: 0; }

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

.services {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
@media (min-width: 44rem) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 72rem) { .services { grid-template-columns: repeat(3, 1fr); } }

.service {
  background: var(--ink);
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 14rem;
  transition: background-color 0.25s ease;
}
.service:hover { background: var(--ink-soft); }
.service__num { font-size: 0.75rem; letter-spacing: 0.16em; color: var(--accent); }
.service h3 { font-size: 1.5rem; }
.service p { margin: 0; color: var(--muted); font-size: 0.925rem; }

/* ---------- portfolio grid ---------- */

.work { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
@media (min-width: 48rem) { .work { grid-template-columns: repeat(2, 1fr); } }

.work__item { display: flex; flex-direction: column; gap: 1rem; text-decoration: none; }
.work__item--wide { grid-column: 1 / -1; }

.work__media {
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  position: relative;
}
.work__item--wide .work__media { aspect-ratio: 21 / 9; }
.work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.work__item:hover .work__media img { transform: scale(1.04); }

.work__count {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  background: rgba(18, 16, 14, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--paper-dim);
}

.work__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.work__meta h3 { font-size: 1.35rem; }
.work__item:hover .work__meta h3 { color: var(--accent); }
.work__meta span { color: var(--muted); font-size: 0.85rem; }

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

.step {
  display: grid;
  gap: 0.5rem 2.5rem;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line);
}
@media (min-width: 56rem) {
  .step { grid-template-columns: 6rem minmax(0, 20ch) minmax(0, 1fr); align-items: start; }
}
.step__num { color: var(--accent); font-size: 0.85rem; letter-spacing: 0.14em; }
.step h3 { font-size: 1.5rem; }
.step p { margin: 0; color: var(--paper-dim); max-width: var(--measure); }

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

.about { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 60rem) { .about { grid-template-columns: 1fr 1fr; } }
.about__media { border-radius: 4px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; }
.about__media img { width: 100%; height: 100%; object-fit: cover; }

.stats { display: grid; gap: clamp(1.75rem, 4vw, 3rem); margin-top: clamp(2.5rem, 6vw, 4rem); }
@media (min-width: 44rem) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat__value {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.75rem, 6vw, 4rem);
  line-height: 1;
  display: block;
}
.stat__label { color: var(--muted); font-size: 0.9rem; }

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

.contact { padding-block: var(--section-y); }
.contact__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 60rem) { .contact__grid { grid-template-columns: 1.1fr 0.9fr; } }
.contact h2 { font-size: clamp(2.25rem, 5.5vw, 4rem); max-width: 14ch; }
.contact__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.contact__list dt {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.contact__list dd { margin: 0; }
.contact__list a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
  display: inline-block;
}
.contact__list a:hover { border-color: var(--accent); color: var(--accent); }

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

.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; color: var(--muted); font-size: 0.85rem; }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer img { height: 46px; width: auto; opacity: 0.75; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--paper); }

/* ==========================================================================
   Project detail page
   ========================================================================== */

.project-hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem); }
.project-hero h1 { font-size: clamp(2.25rem, 5.5vw, 4rem); max-width: 18ch; margin-bottom: 1.5rem; }

.breadcrumb { font-size: 0.8rem; color: var(--muted); margin: 0 0 1.5rem; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.project-meta {
  display: grid;
  gap: 1.5rem 2.5rem;
  margin: 0;
  padding-block: 1.75rem 0;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}
.project-meta dt {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.project-meta dd { margin: 0; font-size: 1.05rem; }

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
  padding-bottom: var(--section-y);
}
@media (min-width: 48rem) { .gallery { grid-template-columns: repeat(2, 1fr); } }

.gallery__item {
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink-soft);
  cursor: zoom-in;
  aspect-ratio: 3 / 2;
  display: block;
  width: 100%;
}
/* first image spans full width as the project's lead shot */
@media (min-width: 48rem) {
  .gallery__item:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.gallery__item:hover img { transform: scale(1.03); }

/* ---------- prev / next ---------- */

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
}
.project-nav a { text-decoration: none; max-width: 20rem; }
.project-nav span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.project-nav strong {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
}
.project-nav a:hover strong { color: var(--accent); }
.project-nav__next { text-align: right; margin-left: auto; }

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 9, 8, 0.96);
  display: flex;
  flex-direction: column;
  padding: clamp(0.75rem, 2vw, 1.5rem);
}
.lightbox[hidden] { display: none; }

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--paper-dim);
  font-size: 0.85rem;
  padding-bottom: 0.75rem;
}

.lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  min-height: 0;
}
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 3px;
}

.lightbox__btn {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(244, 241, 236, 0.06);
  color: var(--paper);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lightbox__btn:hover { background: rgba(244, 241, 236, 0.16); border-color: var(--paper); }
.lightbox__btn--close { width: auto; height: auto; border-radius: 999px; padding: 0.5rem 1.1rem; font-size: 0.85rem; }

body.is-locked { overflow: hidden; }

/* ==========================================================================
   Accessibility helpers
   ========================================================================== */

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

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  text-decoration: none;
}

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

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