/* Adam Schepis — typography-first single page.
   Two faces, one accent, no dependencies. */

:root {
  --paper:  #f4f4f1;
  --ink:    #17181a;
  --muted:  #6c7075;
  --accent: #2f5d7c;
  --hair:   #cfcec8;

  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #131518;
    --ink:    #e8e6e0;
    --muted:  #8a9097;
    --accent: #8fb8d8;
    --hair:   #2c3036;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.98rem + 0.42vw, 1.25rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(3rem, 12vh, 9rem) clamp(1.5rem, 6vw, 3rem) 4rem;
}

/* Masthead: the name is the whole hero. Set large, tight, and level. */
.name {
  margin: 0;
  font-size: clamp(2.75rem, 1.7rem + 5.2vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.rule {
  height: 0;
  margin: clamp(1.25rem, 3vh, 2rem) 0 0;
  border: 0;
  border-top: 1px solid var(--hair);
}

/* The tagline is short enough to set as three stacked lines, not a paragraph. */
.lede {
  margin: clamp(1.5rem, 4vh, 2.25rem) 0 0;
  max-width: 30rem;
  font-size: 1.15em;
  line-height: 1.4;
}

.lede__line { display: block; }

.lede__mark {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
}

.lede__line + .lede__line { color: var(--muted); }

.contact {
  margin-top: clamp(2.5rem, 7vh, 4rem);
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.address {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

/* "at" and "dot" are spelled out; set them back so the address still reads
   as one line rather than three words. */
.address__sep {
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

/* JS swaps the address text for this button, which builds the mailto on click. */
.address__link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color 160ms ease;
}

.address__link:hover { text-decoration-color: var(--accent); }

.address__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color 160ms ease, color 160ms ease;
}

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

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

/* Load sequence: masthead, then the rest, once. */
@media (prefers-reduced-motion: no-preference) {
  .masthead, .lede, .contact {
    animation: rise 620ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }
  .lede    { animation-delay: 90ms; }
  .contact { animation-delay: 180ms; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: none; }
}

/* Break the name onto two lines on narrow screens. */
@media (max-width: 26rem) {
  .name__break { display: block; height: 0; }
}
