:root {
  --bg: #F7F4EE;
  --ink: #14202B;
  --muted: #5A6773;
  --accent: #8B3A2F;
  --rule: #E2DACA;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --maxw-prose: 52rem;
  --maxw-wide: 64rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
a:hover,
a:focus-visible {
  border-bottom-color: var(--accent);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--bg);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
}

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

/* ---------- hero ---------- */

.hero {
  max-width: var(--maxw-prose);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) 1.5rem 2rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-caps: all-small-caps;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.strapline {
  margin: 0.75rem 0 1.75rem;
  font-size: clamp(1.0625rem, 0.9rem + 0.6vw, 1.25rem);
  color: var(--muted);
  text-wrap: balance;
}

.contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9375rem;
}
.contact li { margin: 0; }

/* ---------- main ---------- */

main { padding-bottom: clamp(3rem, 6vw, 5rem); }

.about {
  max-width: var(--maxw-prose);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  hanging-punctuation: first last;
}
.about p {
  margin: 1.25rem 0;
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.1875rem);
  line-height: 1.7;
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
}
.about p:first-of-type { margin-top: 2rem; }

/* ---------- selected work ---------- */

.work {
  max-width: var(--maxw-prose);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid var(--rule);
}

.work h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem);
  margin: 2rem 0 1.5rem;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem 1.25rem 1rem;
  transition: border-color 150ms ease, transform 150ms ease;
}
.card:hover {
  border-color: var(--ink);
}

.card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.card h3 a {
  color: var(--ink);
}
.card h3 a:hover,
.card h3 a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.card p {
  margin: 0.35rem 0 0;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.55;
}
.card .tag {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.more {
  margin: 1.75rem 0 0;
  font-size: 0.9375rem;
}

/* ---------- footer ---------- */

footer {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}
footer p { margin: 0; font-variant-numeric: oldstyle-nums; }
footer .contact { font-size: 0.875rem; }
footer .contact a { color: var(--muted); }
footer .contact a:hover,
footer .contact a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- about: inline "more" disclosure ---------- */

.more-content { display: none; }
#more-toggle:checked ~ .more-content { display: block; }

.more-toggle {
  cursor: pointer;
  font-style: italic;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease;
  white-space: nowrap;
}
.more-toggle:hover {
  border-bottom-color: var(--accent);
}
#more-toggle:focus-visible ~ p .more-toggle {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
/* When the user has clicked "more", hide the label entirely — the
   expanded text is now visible inline so the trigger has done its job. */
#more-toggle:checked ~ p .more-toggle { display: none; }

/* Fallback: every browser gets a solid accent label first. Then progressively
   layer the gradient shimmer on top only on engines that actually support
   background-clip: text — some Android Chrome builds render the clipped
   text fully transparent under animation, leaving the label invisible. */
.more-label {
  color: var(--accent);
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .more-label {
    background-image: linear-gradient(
      100deg,
      var(--accent) 0%,
      var(--accent) 35%,
      #e6c0b4 50%,
      var(--accent) 65%,
      var(--accent) 100%
    );
    background-size: 250% 100%;
    background-position: 200% 0;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: more-shimmer 6s ease-in-out infinite;
  }
}

@keyframes more-shimmer {
  0%, 55%   { background-position: 200% 0; }
  90%, 100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .more-label {
    animation: none;
    background: none;
    -webkit-text-fill-color: var(--accent);
    color: var(--accent);
  }
}

/* ---------- thumb-nav (mobile) ---------- */

.thumb-nav {
  display: none;
}

/* ---------- responsive ---------- */

@media (min-width: 720px) {
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 640px) {
  footer { display: none; }

  body {
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
  }

  .thumb-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--rule);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
  }
  .thumb-nav a {
    flex: 1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-variant-caps: all-small-caps;
    border-bottom: none;
  }
  .thumb-nav a + a {
    border-left: 1px solid var(--rule);
  }
  .thumb-nav a:hover,
  .thumb-nav a:focus-visible {
    color: var(--accent);
    border-bottom: none;
  }
}

@media print {
  .thumb-nav { display: none !important; }
  footer { display: flex !important; }
  body { padding-bottom: 0 !important; }
  /* Print should always show the full blurb and never the "more" trigger,
     regardless of whether the user expanded it on screen. */
  .more-content { display: block !important; }
  .more-toggle  { display: none !important; }
}

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