/* Tatiana Cooper — site styles
   Black and white; the photographs carry the colour. Small, light type throughout.
   Type: Hanken Grotesk (SIL Open Font License), self-hosted, one family for everything. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #111111;
  --muted: #6b6b6b; /* 5.3:1 on white */
  --line: #e6e6e6;
  --paper: #ffffff;
  --wash: #f3f3f3;

  --font: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* Type scale: deliberately small and quiet */
  --fs-xs: 0.6875rem; /* 11px */
  --fs-s: 0.75rem; /* 12px — navigation, labels, captions */
  --fs-m: 0.875rem; /* 14px — reading text */
  --fs-l: 1.25rem; /* 20px — name and page titles */

  --w-thin: 200;
  --w-light: 300;
  --w-text: 350;
  --w-medium: 500;

  --gutter: clamp(16px, 3vw, 40px);
  --max: 1600px;
  --measure: 34rem;
  --header-h: 3.5rem;

  --space-s: 1rem;
  --space-m: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  --space-l: clamp(2.5rem, 1.5rem + 3.5vw, 5rem);
  --space-xl: clamp(3.5rem, 2rem + 5vw, 7rem);

  --slide-h: min(72vh, 62vw, 760px);

  color-scheme: light;
}

@supports (height: 1svh) {
  :root {
    --slide-h: min(72svh, 62vw, 760px);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-m);
  font-weight: var(--w-text);
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

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

picture {
  display: contents;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: inherit;
  font-size: inherit;
}

ul[role="list"] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

strong,
b {
  font-weight: var(--w-medium);
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.4rem 0.6rem;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--fs-s);
}

.skip-link:focus {
  top: 0.5rem;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Small muted text used for labels and metadata */
.label {
  font-size: var(--fs-s);
  font-weight: var(--w-text);
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--muted);
}

.prose {
  max-width: var(--measure);
}

.prose p + p {
  margin-top: 1em;
}

.external {
  font-weight: var(--w-light);
}

/* ---------- Header and navigation ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-inline: var(--gutter);
  line-height: 1.2;
}

.site-header__name {
  font-size: var(--fs-l);
  font-weight: var(--w-thin);
  letter-spacing: 0.09em;
  text-transform: lowercase;
}

.site-header__name a,
a.site-header__name {
  display: inline-block;
  padding-block: 0.5rem;
  text-decoration: none;
}

.site-nav {
  font-size: var(--fs-s);
  font-weight: var(--w-light);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.4em;
}

.site-nav__toggle {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0.75rem 0;
  cursor: pointer;
}

/* Phones: the list is a popover opened by "menu" */
.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__list:popover-open {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  margin: 0;
  padding: calc(var(--header-h) + 0.25rem) var(--gutter) 1.5rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.site-nav__list:popover-open a {
  display: block;
  padding: 0.55rem 0;
  font-size: var(--fs-m);
}

.site-nav__close {
  display: none;
}

.site-nav__list:popover-open .site-nav__close {
  display: flex;
  align-items: center;
  position: absolute;
  top: 0;
  right: var(--gutter);
  height: var(--header-h);
}

.site-nav__close button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0.75rem 0;
  cursor: pointer;
}

.site-nav__list::backdrop {
  background: rgba(255, 255, 255, 0.5);
}

@media (min-width: 768px) {
  .site-nav__toggle {
    display: none;
  }

  /* Always shown on wider screens (overrides the browser's popover hiding) */
  .site-nav__list,
  .site-nav__list:popover-open {
    display: flex;
    position: static;
    inset: auto;
    width: auto;
    gap: clamp(1rem, 1.6vw, 1.5rem);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    overflow: visible;
  }

  .site-nav__list:popover-open .site-nav__close {
    display: none;
  }

  .site-nav__list:popover-open a {
    display: inline;
    padding: 0;
    font-size: inherit;
  }

  .site-nav__list a {
    display: inline-block;
    padding-block: 0.75rem;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: var(--space-xl);
  padding: 1.5rem var(--gutter) 2rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  text-transform: lowercase;
}

.site-footer a {
  color: var(--ink);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Page headers ---------- */

.page-header {
  padding-top: clamp(1.5rem, 1rem + 3vw, 4rem);
  padding-bottom: var(--space-m);
}

.page-header__title,
.project__title {
  font-size: var(--fs-l);
  font-weight: var(--w-light);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.page-header__intro {
  margin-top: 0.75rem;
  max-width: var(--measure);
  color: var(--muted);
}

/* ---------- Home: one photograph filling the screen, header laid over it ---------- */

.page-home .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
}

.home {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 22rem;
  overflow: hidden;
  background: var(--ink);
}

.home__hero {
  position: absolute;
  inset: 0;
}

.home__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Light text over a darker photo (the default). Soft shading at the top keeps the header legible. */
.hero-light .site-header {
  color: #ffffff;
}

.hero-light .home::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8rem;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0));
}

/* Dark text, for a light photo */
.hero-dark .site-header {
  color: var(--ink);
}

/* A faint, flickering TV static over the photograph. A small noise tile (noise.png) is moved to a new
   position about 12 times a second; only a transform changes, so it's cheap to draw. It holds still
   for visitors who prefer reduced motion. */
.home::after {
  content: "";
  position: absolute;
  inset: -100%;
  z-index: 1;
  pointer-events: none;
  background: url("noise.png") repeat;
  background-size: 120px 120px;
  image-rendering: pixelated;
  mix-blend-mode: soft-light;
  opacity: 0.3;
  animation: tv-static 0.66s steps(1, end) infinite;
}

@keyframes tv-static {
  0% { transform: translate(0, 0); }
  12.5% { transform: translate(-7%, 4%); }
  25% { transform: translate(5%, -9%); }
  37.5% { transform: translate(-11%, -3%); }
  50% { transform: translate(9%, 8%); }
  62.5% { transform: translate(-4%, 11%); }
  75% { transform: translate(12%, -6%); }
  87.5% { transform: translate(-9%, -12%); }
  100% { transform: translate(0, 0); }
}

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

/* The open phone menu always uses dark text on white */
.page-home .site-nav__list:popover-open {
  color: var(--ink);
}

.page-home {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* ---------- Image positions (set per image in the CMS) ---------- */

.pos-center { object-position: 50% 50%; }
.pos-top { object-position: 50% 20%; }
.pos-bottom { object-position: 50% 80%; }
.pos-left { object-position: 25% 50%; }
.pos-right { object-position: 75% 50%; }

/* ---------- Project cards (Photography and Creative Projects) ---------- */

.cards {
  display: grid;
  gap: var(--space-l) var(--space-m);
}

@media (min-width: 640px) {
  .cards--portrait {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .cards--landscape {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards--portrait {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card__link {
  display: block;
  text-decoration: none;
}

.card__media {
  overflow: hidden;
  background: var(--wash);
  aspect-ratio: 3 / 2;
}

.cards--portrait .card__media {
  aspect-ratio: 4 / 5;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

.card__link:hover .card__media img {
  opacity: 0.88;
}

.card__title {
  margin-top: 0.75rem;
  font-size: var(--fs-m);
  font-weight: var(--w-text);
  line-height: 1.35;
}

.card__link:hover .card__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.card__summary {
  margin-top: 0.15rem;
  font-size: var(--fs-s);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Project pages ---------- */

.project__info {
  padding-top: var(--space-l);
}

.project__intro {
  display: grid;
  gap: var(--space-m);
  margin-top: var(--space-m);
}

@media (min-width: 900px) {
  .project__intro {
    grid-template-columns: minmax(12rem, 3fr) 9fr;
    column-gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
  }

  .project__text {
    grid-column: 2;
  }

  .project__meta {
    grid-row: 1;
  }
}

.project__meta {
  display: grid;
  gap: 1.25rem;
}

.related {
  display: grid;
  gap: 0.35rem;
  font-size: var(--fs-s);
}

.related a {
  text-underline-offset: 0.3em;
}

.details {
  display: grid;
  gap: 0.75rem;
  font-size: var(--fs-s);
  line-height: 1.45;
}

.details__row {
  display: grid;
  gap: 0.1rem;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
}

/* ---------- Galleries ---------- */

.project__galleries {
  margin-top: clamp(0.5rem, 2vw, 1.5rem);
}

.gallery + .gallery {
  margin-top: var(--space-l);
}

.gallery__heading {
  margin-bottom: 1rem;
}

.gallery__list {
  display: grid;
  gap: var(--space-m);
  list-style: none;
  margin: 0;
  padding: 0;
}

.g-link {
  display: block;
  cursor: zoom-in;
}

.g-link img {
  width: 100%;
  height: auto;
}

/* Printed pages (booklets, magazine spreads) often have white edges; a hairline keeps them off the page */
.project--projects .g-link img {
  box-shadow: 0 0 0 1px var(--line);
}

/* One image after another, as large as the column allows */
.gallery--stack .gallery__list {
  gap: var(--space-l);
  max-width: 1120px;
  margin-inline: auto;
}

/* Tall images are limited to the screen height so they never need scrolling to see whole */
.gallery--stack .g-link.is-tall {
  display: flex;
  justify-content: center;
}

.gallery--stack .g-link.is-tall img {
  width: auto;
  height: min(88vh, 1400px);
  max-width: 100%;
  object-fit: contain;
}

.gallery--narrow .gallery__list {
  max-width: 520px;
  margin-inline: auto;
}

.gallery--stack .gallery__heading {
  max-width: 1120px;
  margin-inline: auto;
}

.gallery--narrow .gallery__heading {
  max-width: 520px;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .gallery--grid-2 .gallery__list {
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }

  .gallery--grid-3 .gallery__list {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }
}

/* ---------- Carousel (assets/js/carousel.js) ---------- */

.carousel {
  position: relative;
}

.carousel + .carousel {
  margin-top: var(--space-l);
}

.carousel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.carousel__viewport::-webkit-scrollbar {
  display: none;
}

.carousel__viewport:focus-visible {
  outline-offset: -1px;
}

.carousel__track {
  position: relative;
  display: flex;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  width: max-content;
  margin: 0;
  padding: 0 var(--gutter);
  list-style: none;
}

.carousel__slide {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.carousel .g-link img {
  width: auto;
  height: var(--slide-h);
  max-width: none;
}

.carousel.is-ready .carousel__slide:not(.is-current) .g-link {
  cursor: pointer;
}

.carousel__btn {
  position: absolute;
  top: calc(var(--slide-h) / 2);
  transform: translateY(-50%);
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-m);
  font-weight: var(--w-light);
  cursor: pointer;
}

.carousel__btn[hidden] {
  display: none;
}

.carousel__btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.carousel__btn--prev {
  left: var(--gutter);
}

.carousel__btn--next {
  right: var(--gutter);
}

.carousel__caption {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-inline: var(--gutter);
  font-size: var(--fs-s);
  color: var(--muted);
  text-align: center;
}

.carousel__count {
  font-variant-numeric: tabular-nums;
}

.carousel:not(.is-ready) .carousel__count {
  display: none;
}

@media (max-width: 767px) {
  .carousel__btn {
    width: 2rem;
    height: 2rem;
  }
}

/* ---------- Pager ---------- */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: var(--space-xl);
  font-size: var(--fs-s);
}

.pager__link {
  display: grid;
  gap: 0.1rem;
  text-decoration: none;
  max-width: 40%;
}

.pager__link--all {
  text-align: center;
  margin-inline: auto;
}

.pager__link--next {
  text-align: right;
}

.pager__label {
  color: var(--muted);
}

.pager__link:hover .pager__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

/* ---------- Writing ---------- */

/* One line per piece: "Title, Publication, Issue 155" */
.writing {
  display: grid;
  gap: var(--space-l);
}

.writing__section {
  max-width: 48rem;
}

.writing__heading {
  margin-bottom: 0.6rem;
  font-size: 0.9375rem;
  font-weight: var(--w-medium);
  letter-spacing: 0.02em;
}

.entries {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  line-height: 1.5;
}

.entry__title {
  text-decoration: none;
}

a.entry__title:hover {
  text-decoration: underline;
}

.entry__source {
  color: var(--muted);
}

/* Publication names are set in italics */
.entry__source cite {
  font-style: italic;
}

.writing__note {
  margin-top: 0.75rem;
  font-size: var(--fs-s);
  color: var(--muted);
}

/* ---------- About ---------- */

.about {
  display: grid;
  gap: var(--space-m);
  padding-top: clamp(1.5rem, 1rem + 3vw, 4rem);
}

.about__portrait img {
  width: 100%;
  max-width: 420px;
}

.about__text .prose {
  margin-top: var(--space-m);
}

.about__more {
  margin-top: var(--space-m);
  font-size: var(--fs-s);
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: 5fr 7fr;
    column-gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
  }
}

/* ---------- Contact ---------- */

.contact__email {
  font-size: var(--fs-l);
  font-weight: var(--w-light);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.contact__list {
  margin-top: var(--space-l);
  max-width: 34rem;
}

.contact__item {
  display: grid;
  gap: 0.1rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 640px) {
  .contact__item {
    grid-template-columns: 12rem 1fr;
    align-items: baseline;
  }
}

/* ---------- 404 ---------- */

.notfound__links {
  display: grid;
  gap: 0.35rem;
}

/* ---------- Lightbox (assets/js/lightbox.js) ---------- */

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0b0b;
  color: #ffffff;
  font-family: var(--font);
  overflow: hidden;
}

.lightbox::backdrop {
  background: #0b0b0b;
}

.lightbox__figure {
  position: absolute;
  inset: 3.5rem var(--gutter) 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__btn {
  position: absolute;
  font: inherit;
  font-size: var(--fs-s);
  font-weight: var(--w-light);
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: #ffffff;
  background: none;
  border: 0;
  padding: 0.75rem;
  cursor: pointer;
}

.lightbox__close {
  top: 0.5rem;
  right: calc(var(--gutter) - 0.75rem);
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-l);
  line-height: 1;
}

.lightbox__prev {
  left: calc(var(--gutter) - 0.75rem);
}

.lightbox__next {
  right: calc(var(--gutter) - 0.75rem);
}

.lightbox__count {
  position: absolute;
  bottom: 1.1rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--fs-s);
  color: #bdbdbd;
}

@media (max-width: 767px) {
  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: 0.35rem;
    transform: none;
  }
}

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