@font-face {
  font-family: "Necto Mono";
  src: url("/fonts/NectoMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f2f1ee;
  --ink: #1b1b1b;
  --ink-soft: #3b3b3b;
  --accent: #c2401a;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scrollbar-gutter: stable;
  background: var(--paper);
  color: var(--ink);
  font-family: "Necto Mono", ui-monospace, Menlo, monospace;
  font-synthesis: none;
  font-size: 100%;
  line-height: 1.5;
}

/* Layout follows the wordmark's guides. The SVG is 5041.4 units wide: a 600-unit clear-space square
   each side of the letters. --sq is one square on screen; --ink-l and --ink-w are the letters'
   left edge and width, which the text and the footer line up with. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: clip;
  --x0: clamp(1rem, 4vw, 3rem);
  --w: min(60rem, calc(100vw - 2 * var(--x0) - 1rem));
  --sq: calc(var(--w) * 600 / 5041.4);
  --ink-l: calc(var(--x0) + var(--sq));
  --ink-w: calc(var(--w) - 2 * var(--sq));
}

em, i, cite { font-style: normal; }

a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* text masks the guides line by line, not as a block */
.status, .lede span, .body span, footer p, .sites a, .motto { position: relative; background: var(--paper); }
.lede span, .body span { -webkit-box-decoration-break: clone; box-decoration-break: clone; }

main {
  align-self: center;
  padding: var(--x0) 1rem var(--x0) var(--ink-l);
}

/* sits on the top edge of the clear space */
/* top right, ending on the letters' right edge line like ozgur.design in the footer */
.status {
  margin: 0;
  padding: 0.25rem 0;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-left: auto;                       /* stays right when the header wraps on narrow screens */
}
/* ASCII slash spinner (same 90ms 4-frame cycle as ozgur.design's hero) while the status loop runs */
.sc-slash { position: relative; display: inline-block; width: 1ch; text-align: center; }
.sc-slash-frames { display: none; }
.sc-slash-frames i { position: absolute; inset: 0; font-style: normal; opacity: 0; animation: sc-spin 360ms steps(1, end) infinite; }
/* frame timings live here, not in style attributes, so the CSP can stay style-src 'self' */
.sc-slash-frames i:nth-child(2) { animation-delay: 90ms; }
.sc-slash-frames i:nth-child(3) { animation-delay: 180ms; }
.sc-slash-frames i:nth-child(4) { animation-delay: 270ms; }
@keyframes sc-spin { 0% { opacity: 1; } 25%, 100% { opacity: 0; } }
.status.is-spinning .sc-slash-idle { visibility: hidden; }
.status.is-spinning .sc-slash-frames { display: block; }

h1 { margin: 0; line-height: 0; }

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

.wordmark {
  display: block;
  width: var(--w);
  height: auto;
  margin-left: calc(-1 * var(--sq));
  overflow: visible;
  /* the vertical guide lines start at y=0 (top of clear space) and stop where the text starts (h1 + .lede's 1.5rem);
     top and sides stay unclipped so the dot can drop in freely from high off-screen left */
  clip-path: inset(-100vh -100vw -1.5rem -100vw);
}
.wordmark .guides { stroke: var(--ink); stroke-opacity: 0.18; stroke-width: 1; stroke-dasharray: 3 3; }
.wordmark .guides line { vector-effect: non-scaling-stroke; }
/* letters drawn as in the Letterforms reel: hatched shading, a hairline outline, anchors and handles.
   Strokes and marks keep their screen size at any scale. */
#ff-hatch rect { fill: #6d6d6a; }
#ff-hatch line { stroke: #4b4b48; stroke-width: 6; }
.wordmark .shade { fill: url(#ff-hatch); }
.wordmark .ink :is(.outline, .handles line, .handles path, .anchors, .anchors-in) { fill: none; vector-effect: non-scaling-stroke; }
.wordmark .outline { stroke: var(--ink); stroke-width: 1.5; }
.wordmark .handles line { stroke: var(--ink); stroke-width: 1; }
.wordmark .handles path { stroke: var(--ink); stroke-width: 3.8; stroke-linecap: round; }
.wordmark .anchors { stroke: var(--ink); stroke-width: 6; stroke-linecap: square; }
.wordmark .anchors-in { stroke: var(--paper); stroke-width: 4; stroke-linecap: square; }

/* starts at the bottom edge of the clear space */
.lede, .body { max-width: min(34rem, var(--ink-w)); margin: 0; padding: 0.5rem 0 0; }
.lede { font-size: clamp(1.25rem, 2.4vw, 1.625rem); line-height: 1.35; }
.body { font-size: 1.0625rem; color: var(--ink-soft); }
.lede + .body { margin-top: 1rem; }
h1 + .lede { margin-top: 1.5rem; }
.nowrap { white-space: nowrap; }
.fleur { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; }

/* The motto sits top left, starting on the letters' left edge line. It plays one round: the Quebec French line,
   then the English one slides up in its place, then the French comes back and stays. */
header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1rem; width: var(--ink-w); margin-left: var(--ink-l); padding-top: var(--x0); }
.motto { display: grid; white-space: nowrap; margin: 0; padding: 0.25rem 0; overflow: hidden; font-size: 0.9375rem; }
.motto span { grid-area: 1 / 1; animation: motto-fr 8s cubic-bezier(.65, 0, .35, 1) both; }
.motto span + span { animation-name: motto-en; }
@keyframes motto-fr {
  0%, 42% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-110%); opacity: 0; }
  50.01%, 92% { transform: translateY(110%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes motto-en {
  0%, 42% { transform: translateY(110%); opacity: 0; }
  50%, 92% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-110%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .motto span { animation: none; }
  .motto span + span { visibility: hidden; }
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  width: var(--ink-w);
  margin-left: var(--ink-l);
  padding: 1.5rem 0 var(--x0);
  font-size: 0.9375rem;
}

footer p { margin: 0; padding: 0.25rem 0; }
/* "Oz Gultekin" starts on the first o's inner left edge line (571.7 units right of the letters' left edge);
   stacked where the year won't fit */
footer p { display: flex; }
footer p span:first-child { flex: none; width: calc(var(--w) * 571.7 / 5041.4); }
/* Narrow screens: header and footer become one left-aligned column on the letters' left edge line,
   and the English lines wrap naturally instead of at their desktop breaks. */
@media (max-width: 40rem) {
  header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .status { margin-left: 0; }
  footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  footer p span:first-child { width: auto; margin-right: 2ch; }
  .lede br { display: none; }
}

.sites { display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.sites a { display: inline-block; padding: 0.25rem 0; }
/* 44 × 44 px pointer targets (WCAG 2.5.5) without moving the text */
.sites a::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: max(100%, 44px); height: 44px; transform: translate(-50%, -50%); }
