/* Studio Takako — palette, shared elements and the gallery lightbox */
:root {
  --bg: #faf6f0;
  --bg-alt: #f1e9df;
  --ink: #2e2a26;
  --ink-soft: #6b6259;
  --line: #e2d7c9;
  --clay: #b5654a;
  --clay-dark: #944f39;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino,
    "Book Antiqua", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  background-attachment: fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--clay-dark);
}

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

footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 2.5rem 1.25rem 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clay);
  margin: 0 0 0.5rem;
}

/* ---------- shared page furniture ---------- */
/* Pages that centre one block between the bar and the footer (home, 404).
   Each page still sets its own type sizes and spacing. */
.page {
  min-height: 100vh; /* fallback for browsers without svh */
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}

/* short clay bar under a heading */
.rule {
  width: 56px;
  height: 2px;
  border: 0;
  background: var(--clay);
  opacity: 0.55;
  margin: 1.5rem 0;
}

.cta {
  display: inline-block;
  padding: 0.7rem 1.7rem;
  border: 1px solid var(--clay);
  border-radius: 999px;
  color: var(--clay-dark);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.82rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.cta:hover {
  background: var(--clay);
  color: #fff;
}

/* ---------- top bar (identical on every page) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.45rem, 1.2vh, 0.7rem) clamp(1rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
}

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

.brand img {
  width: 36px;
  height: 36px;
}

.brand span {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover {
  color: var(--clay-dark);
}

.nav a[aria-current="page"] {
  color: var(--clay-dark);
  border-bottom-color: var(--clay);
}

@media (max-height: 620px) {
  .brand img {
    width: 28px;
    height: 28px;
  }
}

.tile {
  margin: 0;
  cursor: zoom-in;
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-alt);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(30, 26, 22, 0.92);
  z-index: 50;
  /* don't let a drag on the overlay scroll the gallery behind it */
  overscroll-behavior: contain;
}

.lightbox.is-open {
  display: block;
}

/* The figure fills a fixed box between the arrows, so neither the arrows nor
   the caption move when a portrait photo follows a landscape one. */
.lb-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: clamp(1rem, 3vh, 2.25rem) clamp(3.25rem, 7vw, 4.75rem)
    clamp(0.75rem, 2vh, 1.5rem);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-items: center;
  gap: 0.6rem;
}

.lb-fig img {
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  object-fit: contain;
  border-radius: 3px;
}

.lb-fig figcaption {
  font-family: var(--font-display);
  color: #f6efe6;
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  line-height: 1.25;
  text-align: center;
  /* reserves two lines on narrow screens so the caption never shifts */
  min-height: 2.5em;
}

@media (min-width: 900px) {
  .lb-fig figcaption {
    min-height: 1.25em;
  }
}

.lb-close,
.lb-nav {
  background: none;
  border: 0;
  color: #f6efe6;
  cursor: pointer;
  font-size: 2.4rem;
  line-height: 1;
  padding: 0.4rem 0.7rem;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.lb-close:hover,
.lb-nav:hover {
  opacity: 1;
}

.lb-close {
  position: absolute;
  top: 0.6rem;
  right: 1rem;
  z-index: 2;
  font-size: 2.6rem;
}

/* Arrows are pinned to the edges, independent of the photo's size. */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: 3rem;
  padding: 0.6rem 0.9rem;
}

.lb-prev {
  left: clamp(0.25rem, 2vw, 1.25rem);
}

.lb-next {
  right: clamp(0.25rem, 2vw, 1.25rem);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
