/* Andrew Hart, personal site.
   A single letter-like sheet: portrait, name, prose, then quiet lists.
   Ivory paper, ink, forest, gold. Garamond for reading, Inter for labels. */

:root {
  --ivory: #f7f4ed;
  --ink: #22312a;
  --ink-soft: #5c6b62;
  --forest: #2e5a48;
  --gold: #a17c33;
  --hairline: rgba(34, 49, 42, 0.16);
  --hairline-strong: rgba(34, 49, 42, 0.28);
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { min-height: 100%; }

body {
  min-height: 100svh;
  display: grid;
  justify-items: center;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Gradient pinned to the viewport so it never shifts as the page scrolls. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(130% 110% at 50% 0%, #fcf9f3 0%, var(--ivory) 42%, #eee8d8 100%);
}

::selection { background: rgba(161, 124, 51, 0.24); }

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

/* ---------- Sheet ---------- */

.sheet {
  width: min(35rem, 100% - 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2.5rem, 7vh, 4.5rem) 0 4rem;
}

/* ---------- Who ---------- */

.who {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline-strong);
  box-shadow:
    0 0 0 5px var(--ivory),
    0 0 0 6px var(--hairline),
    0 30px 52px -36px rgba(34, 49, 42, 0.6);
}

.name {
  margin-top: 1.7rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.15rem;
  line-height: 1.1;
  letter-spacing: -0.012em;
  white-space: nowrap;
}

/* Post-nominals in small caps, a step quieter than the name. */
.creds {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.role {
  margin-top: 0.7rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.role span { display: block; }
.role-title { font-style: italic; }

.role-firm {
  margin-top: 0.3rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Bio ---------- */

.personal-note {
  width: 100%;
  margin-top: 2.4rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--hairline);
}

.note-body {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
  text-wrap: pretty;
}

.note-body p + p { margin-top: 1.05rem; }

.note-cta {
  margin-top: 1.4rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
}

.note-cta a {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(161, 124, 51, 0.7);
  text-underline-offset: 0.22em;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.note-cta a::after {
  content: "\2192";
  display: inline-block;
  margin-left: 0.4em;
  font-style: normal;
  transition: transform 0.24s var(--ease);
}

.note-cta a:hover { color: var(--ink); text-decoration-color: var(--gold); }
.note-cta a:hover::after { transform: translateX(3px); }

/* ---------- Lists ---------- */

.block {
  width: 100%;
  margin-top: 2.6rem;
}

.block-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--hairline-strong);
}

.rows { list-style: none; }

.rows li:not(:last-child) { border-bottom: 1px solid var(--hairline); }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1.5rem;
  padding: 0.8rem 0;
  color: var(--ink);
  text-decoration: none;
}

.row-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.3;
  transition: color 0.2s;
}

.row-meta {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
  text-align: right;
}

/* Every row ends in an arrow, so it reads as a link without hovering. */
.row::after {
  content: "\2192";
  flex: none;
  order: 3;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1;
  color: var(--gold);
  transition: transform 0.24s var(--ease), color 0.2s;
}

.row-name { flex: 1 1 auto; }

.row:hover .row-name,
.row:focus-visible .row-name {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(161, 124, 51, 0.7);
  text-underline-offset: 0.2em;
}

.row:hover::after,
.row:focus-visible::after { transform: translateX(4px); color: var(--forest); }

/* ---------- Motion ---------- */

.anim { animation: rise 0.9s var(--ease) both; }
.d01 { animation-delay: 0.05s; }
.d02 { animation-delay: 0.14s; }
.d03 { animation-delay: 0.26s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .anim { animation: none; }
  .note-cta a::after, .row::after { transition: none; }
}

/* ---------- Phones ---------- */

@media (max-width: 640px) {
  .sheet { padding: 2.2rem 0 3rem; }
  .avatar { width: 152px; height: 152px; }
  .name { font-size: min(7.2vw, 2.15rem); }

  /* A narrow column cannot justify without gaps: set it ragged right. */
  .note-body { font-size: 1.2rem; text-align: left; hyphens: manual; }
  .note-cta { font-size: 1.2rem; }

  /* Name over detail, so nothing wraps awkwardly or truncates. */
  .row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.1rem 1rem; padding: 0.75rem 0; }
  .row-name { font-size: 1.2rem; grid-column: 1; }
  .row-meta { text-align: left; grid-column: 1; }
  .row::after { grid-column: 2; grid-row: 1 / span 2; }
}
