/* =========================================================================
   Glenn Lyvers — editorial / literary design system
   Light, warm, print-inspired. Three "paths" share one system but each
   carries its own accent (set via html.path-poetry / .path-tech / .path-teaching).
   ========================================================================= */

:root {
  /* Paper & ink */
  --paper:      #f7f3ea;   /* warm cream background            */
  --surface:    #fffdf8;   /* cards / raised surfaces          */
  --ink:        #232019;   /* primary text (warm near-black)   */
  --ink-soft:   #4a4339;   /* secondary text                   */
  --muted:      #786d5d;   /* meta, captions                   */
  --rule:       #e4dccb;   /* hairlines / borders              */
  --rule-soft:  #efe8d8;

  /* Default accent (neutral oxblood) — overridden per path */
  --accent:        #8a3a2e;
  --accent-deep:   #6f2c22;
  --accent-tint:   #f0e6dd;

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --serif:   "EB Garamond", Georgia, "Times New Roman", serif;
  --ui:      "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --measure: 38rem;       /* ideal reading width */
  --wrap:    72rem;
  --frame:   clamp(12px, 1.8vw, 30px);   /* outer matte whitespace */
}

/* Per-path accents */
html.path-poetry   { --accent:#8a3a2e; --accent-deep:#6f2c22; --accent-tint:#f1e7df; }
html.path-tech     { --accent:#356067; --accent-deep:#264a50; --accent-tint:#e2ebe9; }
html.path-teaching { --accent:#937018; --accent-deep:#745812; --accent-tint:#efe7d2; }

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: var(--frame);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
/* gallery-style matte frame: a hairline of whitespace around the whole page */
.page-frame { position: fixed; inset: var(--frame); border: 1px solid var(--rule); border-radius: 10px; pointer-events: none; z-index: 5; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-deep); }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.12; color: var(--ink); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.4rem; margin: 1.6em 0 .4em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; border: 1px solid var(--rule); z-index: 50; }

/* ---------- masthead ---------- */
.masthead { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 88%, #fff); position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(1.1) blur(6px); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: .9rem; padding-bottom: .9rem; }
.brand { display: flex; flex-direction: column; line-height: 1.05; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-tag { font-family: var(--ui); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: .15rem; }

.nav-toggle { display: none; font-family: var(--ui); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; background: none; border: 1px solid var(--rule); border-radius: 999px; padding: .4rem .9rem; color: var(--ink-soft); cursor: pointer; }
.nav-list { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
.nav-list a { font-family: var(--ui); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.nav-list a:hover { color: var(--ink); border-color: var(--accent); }
.nav-list a.is-poetry:hover   { border-color: #8a3a2e; }
.nav-list a.is-tech:hover     { border-color: #356067; }
.nav-list a.is-teaching:hover { border-color: #937018; }

/* ---------- main rhythm ---------- */
.main { padding: 3.5rem 0 4rem; }
.reading { max-width: var(--measure); margin: 0 auto; }
.reading p { margin: 0 0 1.1em; }

/* ---------- hero (landing) ---------- */
.hero { text-align: center; padding: 2rem 0 3rem; margin: 0 auto; }
.hero .eyebrow { font-family: var(--ui); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.2rem; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
.hero .lede { font-size: 1.35rem; color: var(--ink-soft); font-style: italic; margin: .6rem auto 0; max-width: 34rem; }
.rule-mark { width: 64px; height: 1px; background: var(--rule); margin: 2.2rem auto; position: relative; }
.rule-mark::after { content: "❧"; position: absolute; top: -.85em; left: 50%; transform: translateX(-50%); background: var(--paper); padding: 0 .5rem; color: var(--accent); font-size: 1rem; }

/* =========================================================================
   HOME — bento mosaic. An oversized name block + three path tiles of
   different sizes that flood with their accent colour on hover.
   ========================================================================= */
.home .main { padding-top: 1.25rem; }

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "name name name poet"
    "name name name poet"
    "tech tech teach teach";
  gap: clamp(.6rem, 1.2vw, 1.1rem);
  margin: 0;
}
.bento .tile-name      { grid-area: name; }
.bento .p-poetry       { grid-area: poet; }
.bento .p-tech         { grid-area: tech; }
.bento .p-teaching     { grid-area: teach; }

.tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  animation: tileIn .7s cubic-bezier(.2,.7,.2,1) both;
}
.bento .tile:nth-child(1) { animation-delay: .00s; }
.bento .tile:nth-child(2) { animation-delay: .06s; }
.bento .tile:nth-child(3) { animation-delay: .12s; }
.bento .tile:nth-child(4) { animation-delay: .18s; }
@keyframes tileIn { from { opacity: 0; transform: translateY(20px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---- name / marquee tile ---- */
.tile-name {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.8rem, 4vw, 3.4rem);
  background:
    radial-gradient(120% 120% at 0% 0%,   color-mix(in srgb, #8a3a2e 9%, transparent), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, color-mix(in srgb, #356067 9%, transparent), transparent 55%),
    var(--surface);
}
.tile-name .eyebrow { font-family: var(--ui); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.tile-name .big { font-size: clamp(2.6rem, 6.2vw, 5.4rem); line-height: .98; letter-spacing: -0.02em; margin: 0; }
.tile-name .lede { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 2vw, 1.45rem); color: var(--ink-soft); margin: 1rem 0 0; max-width: 30rem; }
.tile-name .name-coords { font-family: var(--ui); font-size: .72rem; letter-spacing: .14em; color: var(--muted); margin-top: 1.5rem; }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.grad {
  background: linear-gradient(100deg, #8a3a2e 0%, #356067 45%, #937018 75%, #8a3a2e 100%);
  background-size: 280% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s ease-in-out infinite;
}
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---- path tiles ---- */
.tile-path {
  --c: var(--accent);
  display: flex; flex-direction: column;
  min-height: clamp(190px, 26vh, 300px);
  padding: clamp(1.3rem, 2.4vw, 2rem);
  text-decoration: none; color: var(--ink);
  border-top: 3px solid var(--c);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s, color .25s;
}
.p-poetry   { --c: #8a3a2e; }
.p-tech     { --c: #356067; }
.p-teaching { --c: #937018; }

/* accent flood that wipes up on hover/focus */
.tile-path::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 72%, #000));
  transform: translateY(101%); transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.tile-path > * { position: relative; z-index: 1; transition: color .25s; }

.tile-no    { font-family: var(--ui); font-feature-settings: "tnum"; font-size: .76rem; letter-spacing: .2em; color: var(--muted); }
.tile-glyph { font-family: var(--display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1; color: var(--c); margin: .35rem 0 .5rem; transition: transform .3s cubic-bezier(.2,.7,.2,1), color .25s; transform-origin: left center; }
.tile-k     { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.05; }
.tile-d     { font-family: var(--serif); color: var(--ink-soft); font-size: 1.02rem; margin: .4rem 0 1rem; max-width: 26rem; }
.tile-go    { margin-top: auto; font-family: var(--ui); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.tile-go::after { content: " →"; display: inline-block; transition: transform .25s; }

.tile-path:hover, .tile-path:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 26px 50px -28px color-mix(in srgb, var(--c) 70%, #000);
  color: #fff; outline: none;
}
.tile-path:hover::before, .tile-path:focus-visible::before { transform: translateY(0); }
.tile-path:hover .tile-no, .tile-path:focus-visible .tile-no,
.tile-path:hover .tile-d,  .tile-path:focus-visible .tile-d,
.tile-path:hover .tile-go, .tile-path:focus-visible .tile-go { color: color-mix(in srgb, #fff 82%, transparent); }
.tile-path:hover .tile-glyph, .tile-path:focus-visible .tile-glyph { color: #fff; transform: rotate(-8deg) scale(1.12); }
.tile-path:hover .tile-go::after, .tile-path:focus-visible .tile-go::after { transform: translateX(4px); }

/* ---------- path portals ---------- */
.portals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 1rem 0 0; }
.portal { --c: var(--accent); position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--c); border-radius: 4px; padding: 2rem 1.6rem 1.6rem; text-decoration: none; color: inherit; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.portal:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -20px color-mix(in srgb, var(--c) 55%, rgba(60,45,25,.5)); border-color: color-mix(in srgb, var(--c) 40%, var(--rule)); }
/* faint techy grid that fades in on hover */
.portal::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .25s ease;
  background-image: linear-gradient(color-mix(in srgb, var(--c) 16%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, transparent) 1px, transparent 1px);
  background-size: 22px 22px; -webkit-mask-image: radial-gradient(120% 80% at 80% 0%, #000 0%, transparent 70%); mask-image: radial-gradient(120% 80% at 80% 0%, #000 0%, transparent 70%); }
.portal:hover::before { opacity: 1; }
.portal > * { position: relative; z-index: 1; }
.portal.poetry   { --c: #8a3a2e; }
.portal.tech     { --c: #356067; }
.portal.teaching { --c: #937018; }
.portal-no { font-family: var(--ui); font-feature-settings: "tnum"; font-size: .72rem; letter-spacing: .18em; color: var(--muted); }
.portal-glyph { font-family: var(--display); font-size: 2.4rem; line-height: 1; color: var(--c); margin: .2rem 0 .8rem; transition: transform .3s cubic-bezier(.2,.7,.2,1); transform-origin: left center; }
.portal:hover .portal-glyph { transform: rotate(-8deg) scale(1.12); }
.portal h2 { margin: 0 0 .4rem; font-size: 1.7rem; }
.portal p { margin: 0 0 1.2rem; color: var(--ink-soft); font-size: 1.05rem; }
.portal .go { margin-top: auto; font-family: var(--ui); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c); }
.portal .go::after { content: " →"; }

/* ---------- poem ---------- */
.poem-page { max-width: 40rem; margin: 0 auto; }
.poem-head { text-align: center; margin-bottom: 2.2rem; }
.poem-head h1 { font-style: italic; font-weight: 400; }
.poem-meta { font-family: var(--ui); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* Each poem's rendered output carries its own line-break mechanism
   (self-contained white-space:pre-wrap div, or <br> tags, or one <p> per line).
   So DO NOT impose white-space:pre-wrap here — it would double the breaks on
   <br>-based poems. Let the verbatim markup control layout. */
.poem-body { font-size: 1.3rem; line-height: 1.75; font-family: var(--serif); }
.poem-body p { margin: 0 0 1.1em; }
.poem-body em { color: var(--ink-soft); }
.poem-body img { margin: 1.4rem auto; border-radius: 3px; }
.poem-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-family: var(--ui); font-size: .82rem; }
.poem-nav a { text-decoration: none; max-width: 46%; }
.poem-nav .dir { display: block; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
.poem-nav .nxt { text-align: right; margin-left: auto; }

/* grouped listings on path landing pages */
.listing-group { margin: 2.6rem auto 0; max-width: var(--measure); }
.listing-group > h2 { font-size: 1.3rem; margin: 0 0 .3rem; border-bottom: 2px solid var(--accent-tint); padding-bottom: .35rem; }
.path-intro { max-width: 40rem; margin: 0 auto 1rem; text-align: center; color: var(--ink-soft); font-style: italic; font-size: 1.25rem; }

/* ---------- listings ---------- */
.page-title { text-align: center; max-width: 40rem; margin: 0 auto 2.5rem; }
.page-title .eyebrow { font-family: var(--ui); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem; }
.index-list { list-style: none; margin: 0 auto; padding: 0; max-width: var(--measure); }
.index-list li { border-bottom: 1px solid var(--rule-soft); }
.index-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .9rem 0; text-decoration: none; color: var(--ink); }
.index-list a:hover { color: var(--accent); }
.index-list .t { font-family: var(--display); font-size: 1.25rem; }
.index-list .d { font-family: var(--ui); font-size: .76rem; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }

/* ---------- service / article content ---------- */
.article { max-width: var(--measure); margin: 0 auto; }
.article h1 { text-align: center; }
.lede-block { font-size: 1.3rem; color: var(--ink-soft); font-style: italic; text-align: center; max-width: 34rem; margin: 0 auto 2.5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1.25rem; margin: 2rem 0; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 1.4rem; }
.card.feature { border-color: var(--accent); box-shadow: 0 10px 26px -18px rgba(60,45,25,.5); }
.card h3 { margin-top: 0; }
.price { font-family: var(--display); font-size: 2rem; color: var(--accent); }
.price small { font-family: var(--ui); font-size: .8rem; color: var(--muted); letter-spacing: .05em; }
.btn { display: inline-block; font-family: var(--ui); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: #fff; padding: .7rem 1.4rem; border-radius: 999px; text-decoration: none; }
.btn:hover { background: var(--accent-deep); color: #fff; }

/* ---------- contact form ---------- */
.contact-form { max-width: 34rem; margin: 0 auto; }
.contact-form p { margin: 0 0 1.1rem; }
.contact-form label { display: block; font-family: var(--ui); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.contact-form input, .contact-form textarea { width: 100%; font-family: var(--serif); font-size: 1.05rem; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: .7rem .8rem; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact-form textarea { resize: vertical; }
.contact-form .hp { position: absolute; left: -5000px; height: 0; overflow: hidden; }
.form-ok { max-width: 34rem; margin: 0 auto; text-align: center; background: var(--accent-tint); border: 1px solid var(--accent); border-radius: 4px; padding: 1.2rem 1.4rem; font-size: 1.15rem; }
.form-errors { max-width: 34rem; margin: 0 auto 1.4rem; list-style: none; padding: .9rem 1.2rem; background: #fbeae6; border: 1px solid var(--accent); border-radius: 4px; color: var(--accent-deep); }
.form-errors li { margin: .2rem 0; }
.contact-alt { text-align: center; color: var(--muted); margin-top: 1.6rem; }
.song audio { width: 100%; max-width: 28rem; margin-top: .4rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 2.5rem 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; }
.footer-brand { font-family: var(--display); font-size: 1.3rem; margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-nav a { font-family: var(--ui); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-meta { font-family: var(--ui); font-size: .76rem; color: var(--muted); margin: 0; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grad, .blink, .tile { animation: none !important; }
  .tile-path, .tile-glyph, .tile-path::before, .tile-go::after { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name name"
      "poet tech"
      "teach teach";
  }
}
@media (max-width: 560px) {
  .bento {
    grid-template-columns: 1fr;
    grid-template-areas: "name" "poet" "tech" "teach";
  }
}
@media (max-width: 760px) {
  .portals { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-block; }
  .nav-list { display: none; width: 100%; flex-direction: column; gap: .25rem; margin-top: .75rem; }
  .nav-list.is-open { display: flex; }
  .masthead-inner { flex-wrap: wrap; }
  .nav { width: 100%; display: flex; flex-direction: column; }
  .nav-toggle { align-self: flex-end; margin-top: -2.2rem; }
}
