/* =====================================================================
   Nicolas Adem — nicolasadem.com
   Ledger paper, ochre, two typefaces. The name resolves; the subtitles type.
   The whole palette is the six variables below. Change them, change the site.
   ===================================================================== */

:root {
  --paper:  #e9ebe6;   /* page — old ledger paper, green-grey */
  --panel:  #e0e3dc;   /* the band under the hero */
  --ink:    #14171a;   /* primary text */
  --ink-2:  #5b6360;   /* secondary text */
  --rule:   #c9cdc5;   /* hairlines, unfilled ticks */
  /* The accent. Used for the caret, the eyebrow, focus rings, link hovers
     and selection — nothing decorative. It has to carry small text, so it
     needs to stay dark enough to read on --paper:
       #7a5c1f  dark ochre        5.2:1  ← current
       #6f5518  darker, browner   5.9:1
       #856224  a shade lighter   4.6:1  (still passes)
       #8a6a2f  lighter still     4.2:1  (borderline — fine for the caret
                                          and rules, weak for the eyebrow)
     Anything lighter than that reads as decoration rather than emphasis. */
  --accent: #7a5c1f;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --container: 980px;
  --pad: clamp(1.15rem, 4vw, 2.25rem);
  --bar: 3.75rem;              /* top bar height, for scroll offsets */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 1rem);
  color-scheme: light;
}

body {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

img { max-width: 100%; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--paper);
  padding: 0.5rem 1rem;
  font-family: var(--sans); font-size: 0.85rem;
}
.skip-link:focus { left: 0; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--bar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  z-index: 50;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.topbar.is-scrolled {
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--rule);
}
.topbar-mark { display: inline-flex; }
.topbar-mark img {
  display: block;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--rule);
}

.topbar-nav { display: flex; align-items: center; gap: clamp(0.85rem, 2.4vw, 1.75rem); }
.topbar-nav a {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-2);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.topbar-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.topbar-page, .topbar-cv { color: var(--ink); }

/* new-tab marker, built in script.js */
.ext-ico {
  display: inline-block;
  width: 0.6em; height: 0.6em;
  margin-left: 0.3em;
  vertical-align: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.55;
}

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

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--bar) + 3rem) 0 clamp(3rem, 9vw, 6rem);
}
.hero-inner { width: 100%; }

.hero-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3.5rem, 13vw, 8.5rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 60;
}
.hero-name .word { display: block; }
/* Each glyph gets a fixed slot so nothing shifts while the name resolves. */
.hero-name .glyph {
  display: inline-block;
  text-align: center;
  white-space: pre;
}
.hero-name .glyph.is-cycling { color: var(--ink-2); }

.hero-typed {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  min-height: 1.7em;
  font-size: clamp(1.1rem, 2.2vw, 1.7rem);
  line-height: 1.6;
  color: var(--ink-2);
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 0.12em;
  vertical-align: -0.16em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

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

/* ---------- sections ---------- */

.section, .contact { padding: clamp(3.5rem, 8vw, 5.75rem) 0; }
.section { border-top: 1px solid var(--rule); }
.contact { border-top: 1px solid var(--rule); background: var(--panel); }

.split {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: start;
}
.split-label {
  position: sticky;
  top: calc(var(--bar) + 1rem);
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--ink-2);
  padding-top: 0.35rem;
}

/* ---------- now ---------- */

.now-list { list-style: none; display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); }
.now-item h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.005em;
  margin-bottom: 0.3rem;
}
.now-item p { color: var(--ink-2); max-width: 58ch; }

/* ---------- fact list (also used on the piano page) ---------- */

.fact-list { list-style: none; }
.fact-list li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.05rem 0;
  border-top: 1px solid var(--rule);
}
.fact-list li:first-child { border-top: none; padding-top: 0; }
.fact-label {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-2);
  padding-top: 0.28rem;
}
.fact-body { color: var(--ink); max-width: 58ch; }

/* ---------- log ---------- */

.log-list { list-style: none; }
.log-item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.05rem 0;
  border-top: 1px solid var(--rule);
}
.log-item:first-child { border-top: none; padding-top: 0; }
.log-date {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  padding-top: 0.28rem;
}
.log-body h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}
.log-body p { color: var(--ink-2); max-width: 58ch; }
.log-empty { color: var(--ink-2); }

/* ---------- contact ---------- */

.contact-line { max-width: 46ch; color: var(--ink-2); }
.contact-email {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: break-word;
  border-bottom: 2px solid var(--rule);
  transition: border-color 0.25s ease, color 0.25s ease;
}
.contact-email:hover { border-bottom-color: var(--accent); color: var(--accent); }
/* Before the address is revealed the label is a prompt, not an address,
   so it shouldn't be set at address size. */
.contact-email:not(.is-revealed) {
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  color: var(--ink-2);
}

.contact-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-2);
}
.contact-meta-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.contact-meta a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.contact-meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- subpages (piano/, and anything else you add) ---------- */

.page-hero { padding: calc(var(--bar) + clamp(3rem, 9vw, 6rem)) 0 clamp(2rem, 5vw, 3rem); }
.eyebrow-line {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--accent);
}
.page-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 0.7rem;
  font-variation-settings: "opsz" 60;
}
.page-lede {
  max-width: 54ch;
  margin-top: 1.2rem;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-2);
}
.prose { max-width: 62ch; }
.prose p + p { margin-top: 0.9rem; }
.prose strong { font-weight: 600; }

.page-footer { border-top: 1px solid var(--rule); padding: 1.75rem 0 2.25rem; }
.page-footer .contact-meta { margin-top: 0; padding-top: 0; border-top: none; }

/* ---------- repertoire (piano page) ---------- */

.repertoire-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.75rem, 5vw, 3.5rem);
  max-width: 860px;
}
.repertoire-head {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}
.repertoire-list { list-style: none; }
.repertoire-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
}
.repertoire-list li:first-child { border-top: none; }
.repertoire-list li span {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.repertoire-note { margin-top: 1.4rem; color: var(--ink-2); font-style: italic; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 1.4rem;
}
.media-grid img { width: 100%; display: block; }
.media-video { margin-top: 1.4rem; aspect-ratio: 16 / 9; max-width: 720px; }
.media-video iframe { width: 100%; height: 100%; border: 0; }
.award-quote { margin-top: 1.4rem; max-width: 56ch; font-style: italic; }
.award-quote cite {
  display: block;
  margin-top: 0.4rem;
  font-style: normal;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 0.82rem;
}

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

@media (min-width: 1500px) {
  :root { --container: 1120px; }
  body { font-size: 1.125rem; }
}

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; gap: 0.9rem; }
  .split-label { position: static; padding-top: 0; }
  .repertoire-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .hero-typed { min-height: 3.3em; }   /* two lines, so cycling never reflows */
  .fact-list li, .log-item { grid-template-columns: 1fr; gap: 0.15rem; }
  .fact-label, .log-date { padding-top: 0; }
}

@media (max-width: 430px) {
  :root { --bar: 3.25rem; }
  .topbar-mark img { width: 30px; height: 30px; }
  .topbar-nav { gap: 0.7rem; }
  .topbar-nav a { font-size: 0.76rem; }
  .hero-name { font-size: clamp(3rem, 16vw, 4.5rem); }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; opacity: 1; }
  * { transition-duration: 0.01ms !important; }
}
