/* ==========================================================================
   Portfolio — style.css
   Everything you are likely to want to change lives in :root below.
   ========================================================================== */

:root {
  /* Colours ------------------------------------------------------------- */
  --bg:         #fbfaf7;   /* page background, a warm off-white */
  --ink:        #1a1a1a;   /* body text */
  --ink-muted:  #6b6b66;   /* metadata, secondary text */
  --rule:       #d9d6cf;   /* hairlines */
  --accent:     #c8401f;   /* the one accent: entry numbers, links, hover */
  --overlay:    rgba(26, 26, 26, 0.55);  /* dimmed page behind the notice dialog */

  /* Type ---------------------------------------------------------------- */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;

  --text-xs:  0.75rem;    /* metadata, footer */
  --text-sm:  0.9375rem;  /* entry paragraphs */
  --text-md:  1.0625rem;  /* about body */
  --text-lg:  1.375rem;   /* entry titles, section headings */
  --text-xl:  clamp(1.5rem, 1rem + 2vw, 2.25rem); /* statement */

  --leading-tight: 1.2;
  --leading-body:  1.55;

  /* Spacing (a simple scale) -------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 7rem;

  /* Layout -------------------------------------------------------------- */
  --page-max:  84rem;   /* overall content width */
  --measure:   34em;    /* max line length for running text */
  --gutter:    clamp(1rem, 4vw, 3rem);   /* side padding */
  --gap:       clamp(1.5rem, 3vw, 3rem); /* grid gap */
  --image-ratio: 8 / 5; /* all project images are cropped to this */
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 100%;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover,
a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

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

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

ol, ul {
  padding: 0;
  list-style: none;
}

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

/* Shared page frame --------------------------------------------------- */

.site-header,
.statement,
.work,
.about,
.site-footer {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header -------------------------------------------------------------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3) var(--space-5);
  padding-top: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--rule);
}

.site-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

.site-role {
  margin-top: var(--space-1);
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.site-nav ul {
  display: flex;
  gap: var(--space-4);
}

.site-nav a {
  font-family: var(--sans);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Statement ----------------------------------------------------------- */

.statement {
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
}

.statement p {
  max-width: var(--measure);
  font-size: var(--text-xl);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.statement p.statement__note {
  margin-top: var(--space-4);
  font-family: var(--sans);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  letter-spacing: 0;
  color: var(--ink-muted);
}

/* Section headings ---------------------------------------------------- */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding-top: var(--space-4);
  padding-bottom: var(--space-5);
  border-top: 1px solid var(--rule);
}

.section-head h2 {
  font-weight: 400;
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
}

.section-head__count {
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* Work grid ----------------------------------------------------------- */

.work {
  padding-bottom: var(--space-7);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6) var(--gap);
  counter-reset: entry;
}

@media (min-width: 40em) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64em) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.entry {
  counter-increment: entry;
  display: flex;
  flex-direction: column;
}

.entry img {
  width: 100%;
  aspect-ratio: var(--image-ratio);
  object-fit: cover;
  background: var(--rule);
}

.entry__title {
  margin-top: var(--space-3);
  font-weight: 400;
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

/* Catalogue-style plate number before each title */
.entry__title::before {
  content: counter(entry, decimal-leading-zero);
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.entry__meta {
  margin-top: var(--space-2);
  font-family: var(--sans);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.entry__text {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  max-width: var(--measure);
  text-wrap: pretty;
}

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

.about {
  padding-bottom: var(--space-7);
}

.about__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5) var(--gap);
}

@media (min-width: 64em) {
  .about__body { grid-template-columns: 2fr 1fr; }
}

.about__body p {
  max-width: var(--measure);
  font-size: var(--text-md);
  text-wrap: pretty;
}

.facts {
  font-family: var(--sans);
  font-size: var(--text-sm);
}

.facts div {
  padding: var(--space-2) 0;
  border-top: 1px solid var(--rule);
}

.facts div:last-child {
  border-bottom: 1px solid var(--rule);
}

.facts dt {
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}

.facts dd {
  margin-top: var(--space-1);
}

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-top: var(--space-4);
  padding-bottom: var(--space-5);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.site-footer__contact a {
  color: var(--ink);
}

.site-footer__note {
  flex-basis: 100%;
  margin-top: var(--space-2);
}

.site-footer__note a {
  text-decoration: underline;
}

/* Notice dialog (shown on load) ---------------------------------------- */

.notice {
  width: min(100% - 2 * var(--gutter), 34rem);
  margin: auto;
  padding: var(--space-5) var(--space-5) var(--space-4);
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
}

.notice::backdrop {
  background: var(--overlay);
}

.notice__label {
  font-family: var(--sans);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.notice__title {
  margin-top: var(--space-2);
  font-weight: 400;
  font-size: var(--text-lg);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.notice__text {
  margin-top: var(--space-3);
  font-size: var(--text-md);
  text-wrap: pretty;
}

.notice__text a {
  text-decoration: underline;
}

.notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-4);
}

/* Buttons --------------------------------------------------------------- */

.button {
  display: inline-block;
  padding: 0.7em 1.1em;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.button--primary {
  background: var(--ink);
  color: var(--bg);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* Motion / print ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-nav { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .entry { break-inside: avoid; }
}
