@font-face {
  font-family: 'Latin Modern Roman';
  src: url('fonts/lm-roman-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Latin Modern Roman';
  src: url('fonts/lm-roman-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Latin Modern Roman';
  src: url('fonts/lm-roman-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Latin Modern Roman';
  src: url('fonts/lm-roman-bolditalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

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

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-2);
}

a {
  color: var(--color-text);
  text-decoration-color: var(--color-accent);
}

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

/* Tables: horizontal rules only (booktabs style) — 1px text-colored lines
   above the header, below it, and below the last row. No vertical lines, no
   zebra fill. display:block + overflow lets wide tables scroll on narrow
   screens instead of overflowing the page. */
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  border-top: 1px solid var(--color-text);
  border-bottom: 1px solid var(--color-text);
}

th,
td {
  padding: 0.4em 0.9em;
  text-align: left;
  vertical-align: top;
}

thead th {
  font-variant-caps: small-caps;
  border-bottom: 1px solid var(--color-text);
}

a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 1px solid var(--color-accent);
  outline-offset: 2px;
}

/* Titles/headings: small caps, written in normal sentence case, underlined
   in the accent color with the underline sitting well below the baseline. */
.brand-title,
h1,
h2,
h3 {
  font-variant-caps: small-caps;
  letter-spacing: 0.02em;
  /* tune visually — see CLAUDE.md branding spec */
  font-weight: 700;
}

/* .brand-title (the site logo) never wraps, so a plain text-decoration
   underline is fine. h1/h2/h3 can wrap onto several lines, where
   text-decoration would draw a rule under every line — border-bottom on a
   width: fit-content box draws exactly one rule, under the last line only,
   sized to the widest rendered line (plain shrink-to-fit width would just
   stretch to the full container width once wrapping kicks in — fit-content
   is the part that actually hugs the wrapped text). */
.brand-title {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.85em;
}

h1,
h2,
h3 {
  width: fit-content;
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 0.85em;
}

/* Space below the page title's underline, before the content that follows.
   A property can opt a specific title out of this (e.g. a homepage hero
   that centers as a single block) with a more specific selector of its
   own — see that property's local stylesheet. */
h1 {
  margin-bottom: var(--space-4);
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.site-header__logo {
  font-size: 1.25rem;
  text-decoration-thickness: 1px;
}

.site-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid #eee;
  font-size: 0.875rem;
  color: #555;
}

/* Sticky-footer page shell (all pages): header/footer keep their natural
   height, main fills whatever viewport space is left so the footer sits
   at the bottom of the viewport on short pages. min-height (not height)
   means a very short viewport just grows/scrolls the page instead of
   clipping content. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main {
  flex: 1;
}

.button-group {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: stretch;
}

.button {
  /* Reset <button> UA defaults (font, background, radius) first, so a
     real <button class="button"> (e.g. a form submit) renders identically
     to the <a class="button"> links this class was designed for — the
     rest of the rule then applies on top, same as for the anchor case. */
  appearance: none;
  background: none;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
  display: inline-block;
  padding: 0.6em 1em;
  border: 1px solid var(--color-text);
  color: var(--color-text);
  text-decoration: none;
  font-variant-caps: small-caps;
  letter-spacing: 0.02em;
  transition: border-color 140ms ease, color 140ms ease;
}

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

/* Forms: shared by any property that collects input (contact/work-with-me
   forms today, a future CV chat box, etc). Same "never a fill" rule as
   .button — plain bordered fields, no background color of their own. */
form {
  max-width: 60ch;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  margin-bottom: var(--space-2);
}

.field__label {
  font-size: 0.95rem;
}

.field__control {
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-text);
  padding: 0.6em 0.75em;
}

textarea.field__control {
  resize: vertical;
  min-height: 8em;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: var(--space-2);
}

.checkbox-field input[type="checkbox"] {
  accent-color: var(--color-accent);
}

/* Async submit feedback. --color-success/--color-error are the one
   sanctioned exception to the one-accent rule (see CLAUDE.md's branding
   spec) — kept discreet: a thin border, not a fill or a large area. */
.form-status {
  margin-top: var(--space-2);
  padding-left: 0.75em;
  border-left: 2px solid transparent;
}

.form-status--success {
  border-left-color: var(--color-success);
}

.form-status--error {
  border-left-color: var(--color-error);
}

.site-footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.site-footer__legal {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-footer__copyright {
  margin: 0;
}

.site-footer__github {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: var(--color-text);
  -webkit-mask-image: url('github.svg');
  mask-image: url('github.svg');
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 140ms ease;
}

.site-footer__github:hover,
.site-footer__github:focus-visible {
  background-color: var(--color-accent);
}

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

.site-footer__legal a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
}

/* Subaya build credit — wordmark asset only, per Subaya's own brand
   guidelines (never retyped as text). Colors/font are Subaya's, not
   sonibla' tokens — see CLAUDE.md identity exception. */
.site-footer__credit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.site-footer__credit-label {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #655e56;
  transition: color 140ms ease;
}

.site-footer__credit:hover .site-footer__credit-label,
.site-footer__credit:focus-visible .site-footer__credit-label {
  color: #2c56a8;
}

.site-footer__credit-logo {
  height: 14px;
  width: auto;
  display: block;
}