/* ============================================================
   SITE STYLESHEET — one file, shared by /en and /es
   Previously duplicated in en/css/ and es/css/, which meant every
   change had to be made twice and eventually wouldn't be.
   ============================================================ */

/* ---- Tokens -------------------------------------------------
   Your four link colours were four unrelated golds. Here they're
   one gold with a light and dark step, which is what makes a
   palette read as deliberate instead of accumulated.
   ------------------------------------------------------------ */
:root {
  --ink:          #000000;   /* page */
  --surface:      #0b0a08;   /* very slightly warm raised black */
  --gold:         #a59756;   /* yours — the anchor */
  --gold-bright:  #ffe25f;   /* yours — hover only */
  --gold-dim:     #4e4830;   /* derived — hairlines, borders */
  --paper:        #e6e1d3;   /* body text. NOT pure white: #fff on
                                #000 is harsh and fights the gold */

  --display: 'Aboreto', serif;          /* was `cursive` — wrong family */
  --mono:    'Roboto Mono', ui-monospace, monospace;
  --script:  'Monsieur La Doulaise', cursive;

  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --fast:     180ms;
  --measured: 320ms;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --stack:  clamp(2.5rem, 6vw, 4.5rem);
}

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

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

body {
  margin: 0;
  padding: var(--stack) var(--gutter);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
  line-height: 1.65;
  max-width: 68rem;
  margin-inline: auto;
}

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

/* ---- Accessibility utilities ------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--gold); color: var(--ink);
  padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { left: var(--gutter); top: 1rem; }

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

/* ---- Masthead ---------------------------------------------- */
.masthead { text-align: center; margin-bottom: var(--stack); }

.mark { margin-inline: auto; margin-bottom: 1.5rem; }

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.42em;   /* mono + wide tracking = the "tech" half
                               of your identity, set in type */
  text-indent: 0.42em;      /* compensates trailing letter-space so
                               centred text is actually centred */
  text-transform: uppercase;
  color: var(--gold-dim);
}

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  line-height: 1.1;
  color: var(--gold);
}

.lang {
  margin-top: 1.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.lang-sep { margin: 0 0.6rem; }

/* ---- Links --------------------------------------------------
   ORDER MATTERS. It must be :link, :visited, :hover, :active.
   Your original had :hover and :active BEFORE :visited/:link.
   Same specificity means the later rule wins, so :link was
   overriding :hover and your hover colour never appeared.
   ------------------------------------------------------------ */
a:link    { color: var(--gold); text-decoration: none; }
a:visited { color: var(--gold); }
a:hover   { color: var(--gold-bright); }
a:active  { color: var(--gold-bright); }

/* Text links get a rule that draws in from the left rather than a
   colour flash. 200ms, eased, on interaction only. */
.lang a {
  position: relative;
  padding-bottom: 2px;
}
.lang a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--fast) var(--ease);
}
.lang a:hover::after,
.lang a:focus-visible::after { transform: scaleX(1); }

/* ---- The plates --------------------------------------------
   Was: four centred 300x150 images stacked, fixed width.
   Now: a fluid grid that collapses to one column on a phone.
   ------------------------------------------------------------ */
.plates {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.plate-link {
  display: block;
  color: var(--gold);
}

.plate-frame {
  display: block;
  border: 1px solid var(--gold-dim);
  background: var(--surface);
  overflow: hidden;      /* keeps the scaling image inside the frame */
  aspect-ratio: 2 / 1;
  transition: border-color var(--measured) var(--ease);
}

.plate-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* At rest the art is held back; on hover it comes up to full.
     This is the cheapest way to make a grid of images feel
     composed rather than pasted. */
  filter: grayscale(0.55) brightness(0.78);
  transform: scale(1.0);
  transition:
    filter var(--measured) var(--ease),
    transform var(--measured) var(--ease);
}

.plate-link:hover .plate-frame,
.plate-link:focus-visible .plate-frame { border-color: var(--gold); }

.plate-link:hover .plate-frame img,
.plate-link:focus-visible .plate-frame img {
  filter: grayscale(0) brightness(1);
  transform: scale(1.03);
}

.plate-body {
  display: block;
  padding-top: 0.9rem;
}

.plate-label {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color var(--fast) var(--ease);
}

.plate-link:hover .plate-label,
.plate-link:focus-visible .plate-label { color: var(--gold-bright); }

.plate-note {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* ---- Colophon -----------------------------------------------
   Monsieur La Doulaise is a hairline copperplate script. You had
   it at `font-size: small`, where it's illegible mush. It's a
   signature face — used once, large, like a signed canvas.
   ------------------------------------------------------------ */
.colophon { margin-top: var(--stack); text-align: center; }

.rule {
  border: 0;
  border-top: 1px solid var(--gold-dim);
  margin: 0 auto var(--stack);
  max-width: 8rem;
}

.signature {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(2.75rem, 8vw, 4.25rem);
  line-height: 1;
  color: var(--gold);
}

.colophon-note {
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* ---- 404 page ------------------------------------------------- */
.error-page {
  min-height: 60vh;
  display: grid;
  place-content: center;
  gap: 1.25rem;
  text-align: center;
}
.error-page .title { font-size: clamp(3rem, 12vw, 6rem); }

/* ---- Binary rain (projects page) ---------------------------
   Spacing between digits is done here with letter-spacing, so the
   JS no longer has to inject &nbsp entities into the string.
   ------------------------------------------------------------ */
.binary {
  font-family: var(--mono);
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.5em;
  color: var(--gold-dim);
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}
.binary-row { display: block; }

/* ---- Motion -------------------------------------------------
   ONE entrance, once, on load. 18px of travel, 60ms stagger.
   Anything more and it reads as a template.
   ------------------------------------------------------------ */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.masthead > *,
.plate,
.colophon > * {
  animation: rise var(--measured) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.masthead > *:nth-child(1) { --i: 0; }
.masthead > *:nth-child(2) { --i: 1; }
.masthead > *:nth-child(3) { --i: 2; }
.masthead > *:nth-child(4) { --i: 3; }
.colophon > *              { --i: 4; }

/* Cross-page transitions. Two lines. Chromium fades between pages
   instead of the white flash; everywhere else it does nothing and
   nothing breaks. This is most of why expensive sites feel
   expensive when you click through them. */

/*@view-transition { navigation: auto; }*/
/* Left out temporarily because it causes Instagrams browser not to work*/

/* ---- Reduced motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  @view-transition { navigation: none; }
}
