/* nav: profiles after a thin divider */
.nav nav { align-items: center; }
.nav-rule { width: 1px; height: 12px; background: var(--line); }

.tongues { margin-top: 26px; font-family: "Cinzel", var(--serif); font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); }

/* ---- sky scrim (keeps text legible over a bright sky) ---- */
/* --scrim-l / --scrim-r: darkening at the left / right edge; clear (undarkened) between --clear-a and
   --clear-b (% of the width). In Work the text is on the right and the carved steps on the left, so the
   scrim swaps sides there (main.js sets body.at-work). */
@property --scrim-l { syntax: "<number>"; inherits: true; initial-value: 0.78; }
@property --scrim-r { syntax: "<number>"; inherits: true; initial-value: 0.35; }
@property --clear-a { syntax: "<number>"; inherits: true; initial-value: 60; }
@property --clear-b { syntax: "<number>"; inherits: true; initial-value: 70; }
body { transition: --scrim-l 0.9s ease, --scrim-r 0.9s ease, --clear-a 0.9s ease, --clear-b 0.9s ease; }
body.at-work { --scrim-l: 0; --scrim-r: 0.8; --clear-a: 30; --clear-b: 42; }
body.has-sky::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 7, 11, var(--scrim-l)) 0%, rgba(6, 7, 11, calc(var(--scrim-l) * 0.45)) 38%, transparent calc(var(--clear-a) * 1%), transparent calc(var(--clear-b) * 1%), rgba(6, 7, 11, var(--scrim-r)) 100%);
}

/* ---- Work: the ascent (timeline beside the carved steps) ---- */
.ascent { list-style: none; margin-top: 30px; }
.ascent li {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  opacity: 0.28;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.8); /* legible over the stone */
  transition: opacity 0.6s ease, border-color 0.6s ease;
}
.ascent li.on { opacity: 1; border-left-color: var(--gold); }
.ascent .yr { font-family: "Cinzel", var(--serif); font-size: 13px; letter-spacing: 0.3em; color: var(--gold); }
.ascent .yr small { margin-left: 10px; font-family: var(--serif); font-style: italic; font-size: 15px; letter-spacing: 0; color: var(--muted); }
.ascent h3 { margin: 10px 0 4px; font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.15; }
.ascent .org { font-family: "Cinzel", var(--serif); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #c9bfa9; }
.ascent .desc { margin-top: 14px; font-size: 14px; line-height: 1.7; color: #c3bbac; max-width: 30em; }
.ascent .desc + .desc { margin-top: 10px; }
.translation { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: 19px; color: #d6cdbc; }
.motto { margin-top: 12px; font-family: "Cinzel", var(--serif); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.motto::before { content: "- "; }
#projects h2 { font-size: clamp(30px, 3.2vw, 44px); text-wrap: balance; }
.ascent p a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ---- sound button ---- */
.sound { display: flex; align-items: flex-end; gap: 2px; height: 14px; padding: 0 2px; background: none; border: 0; cursor: pointer; }
.sound span { width: 2px; height: 3px; background: var(--muted); transition: background 0.3s; }
.sound.on span { background: var(--gold); animation: eq 1.1s ease-in-out infinite; }
.sound.on span:nth-of-type(2) { animation-delay: -0.3s; }
.sound.on span:nth-of-type(3) { animation-delay: -0.6s; }
.sound.on span:nth-of-type(4) { animation-delay: -0.9s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 13px; } }
/* while the sound is off: "Turn on sound" in gold beside the bars, in the nav's own lettering, and the bars ripple softly */
.sound { align-items: center; font-family: inherit; }
.sound-label {
  max-width: 0; margin-right: 0; overflow: hidden; white-space: nowrap; opacity: 0;
  font-style: normal; font-size: 11px; line-height: 14px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
  transition: max-width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), margin-right 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s, color 0.3s;
}
.sound.hinting .sound-label { max-width: 14em; margin-right: 12px; opacity: 1; }
.sound:hover .sound-label { color: #f1e9da; }
.sound span { align-self: flex-end; }
.sound.hinting span { animation: ripple 1.8s ease-in-out infinite; }
.sound.hinting span:nth-of-type(2) { animation-delay: -1.35s; }
.sound.hinting span:nth-of-type(3) { animation-delay: -0.9s; }
.sound.hinting span:nth-of-type(4) { animation-delay: -0.45s; }
@keyframes ripple { 0%, 100% { height: 3px; } 50% { height: 8px; } }
@media (prefers-reduced-motion: reduce) { .sound.hinting span { animation: none; } }


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

/* ---- the book (the hero is a book on a lectern; the hero text is for screen readers only) ---- */
#hero.book { min-height: 190vh; align-items: flex-start; } /* the camera holds on the book while this scrolls past */
body.at-book { --scrim-l: 0; --scrim-r: 0; }

/* ---- nav: legible over any sky (a soft dark band behind it, brighter text) ---- */
.nav::before { content: ""; position: absolute; inset: 0 0 -46px 0; z-index: -1; pointer-events: none; background: linear-gradient(rgba(6, 7, 11, 0.62), rgba(6, 7, 11, 0.32) 55%, rgba(6, 7, 11, 0)); }
.nav nav a { color: #ece4d4; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75); }
.nav nav a:hover { color: var(--gold); }
.nav-rule { background: rgba(236, 228, 212, 0.45); }
.sound span { background: #ece4d4; }
.mono.greek { font-family: "GFS Didot", var(--serif); font-size: 25px; letter-spacing: 0.14em; color: #f1e9da; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7); }

/* ---- the scroll cue: on screen all the way down, easy to spot over any part of the scene ---- */
.scroll-cue {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 5;
  padding: 11px 20px; border-radius: 999px; border: 1px solid rgba(201, 164, 92, 0.65);
  background: rgba(8, 9, 14, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #f3ecdf; font-size: 11px; letter-spacing: 0.32em; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition: opacity 0.5s ease;
}
.scroll-cue b { font-weight: 500; }
.scroll-cue span { width: 46px; background: rgba(243, 236, 223, 0.3); }
.scroll-cue span::after { background: var(--gold); }
.scroll-cue:hover { border-color: var(--gold); }
.scroll-cue.gone { opacity: 0; pointer-events: none; }

/* ---- Expertise: the pillar in view, laid out like a Work entry (scroll only: no hover states) ---- */
.pillar-index { list-style: none; display: flex; gap: 20px; margin-top: 30px; font-family: "Cinzel", var(--serif); font-size: 12px; letter-spacing: 0.2em; color: var(--muted); }
.pillar-index li { padding-bottom: 6px; border-bottom: 1px solid transparent; transition: color 0.5s, border-color 0.5s; }
.pillar-index li.on { color: var(--gold); border-bottom-color: var(--gold); }
.pillar { margin-top: 30px; padding-left: 22px; border-left: 1px solid var(--gold); max-width: 30em; text-shadow: 0 0 18px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.8); }
.pillar.in { animation: pillarIn 0.6s ease; }
@keyframes pillarIn { from { opacity: 0; transform: translateY(8px); } }
.pillar .yr { font-family: "Cinzel", var(--serif); font-size: 13px; letter-spacing: 0.3em; color: var(--gold); }
.pillar .yr small { margin-left: 10px; font-family: var(--serif); font-style: italic; font-size: 15px; letter-spacing: 0; color: var(--muted); }
.pillar h3 { margin: 10px 0 0; font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.15; }
.pillar ul { list-style: none; margin-top: 18px; display: grid; gap: 14px; }
.pillar li b { display: block; font-family: "Cinzel", var(--serif); font-weight: 400; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #c9bfa9; }
.pillar li span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.6; color: #c3bbac; }
#skills .sticky { justify-content: flex-start; padding-top: clamp(96px, 25vh, 340px); } /* a fixed top (level with the temple), not centred: the heading never moves, the panel grows downwards */
.email { font-size: clamp(20px, 1.7vw, 24px); }

/* ---- phones (upright or sideways) and narrow screens: the links fold into a menu; the sound button stays in
   the header ---- */
.menu-btn { display: none; }
@media (max-width: 800px), (max-height: 500px) {
  .chapters { display: none; }
  .nav { padding: 18px 22px 0; gap: 18px; }
  .nav nav { display: flex; margin-left: auto; gap: 0; }
  .nav nav > a, .nav-rule { display: none; }
  .menu-btn {
    display: block; position: relative; z-index: 2; padding: 8px 0 8px 6px; background: none; border: 0; cursor: pointer;
    font: 400 11px var(--sans); letter-spacing: 0.28em; text-transform: uppercase; color: #ece4d4; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
  }
  .nav.open nav {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
    background: rgba(5, 7, 12, 0.96);
  }
  .nav.open nav > a { display: block; font-family: "Cinzel", var(--serif); font-size: 15px; letter-spacing: 0.3em; }
  .nav.open .nav-rule { display: block; width: 40px; height: 1px; }
  .sound-label { font-size: 10px; letter-spacing: 0.2em; }
  .sound.hinting .sound-label { margin-right: 10px; }
  .scroll-cue { bottom: 18px; padding: 9px 16px; white-space: nowrap; font-size: 10px; letter-spacing: 0.26em; }
  .scroll-cue span { width: 30px; }
  .nav.open ~ .scroll-cue { opacity: 0; pointer-events: none; }
}

/* ---- upright phones: the scene in the upper part of the screen, the text below it on a dark fade ---- */
@media (max-width: 800px) and (orientation: portrait) {
  body.has-sky::before, body.at-work.has-sky::before {
    background: linear-gradient(to top, rgba(6, 7, 11, 0.92) 0%, rgba(6, 7, 11, 0.72) 38%, rgba(6, 7, 11, 0) 62%);
  }
  body.at-work.has-sky::before { background: linear-gradient(to top, rgba(6, 7, 11, 0.94) 0%, rgba(6, 7, 11, 0.86) 50%, rgba(6, 7, 11, 0) 70%); } /* long entries: the steps keep the top third */
  body.at-book.has-sky::before { background: none; }
  .col, .col.right { width: auto; margin: 0 24px; }
  h2 { font-size: 34px; }
  .eyebrow { margin-bottom: 14px; }
  /* Work: the steps above; the timeline scrolls up through the lower half */
  #projects { padding: 52vh 0 34vh; }
  #projects h2 { font-size: 28px; }
  .ascent li { min-height: 0; margin-bottom: 34vh; }
  .ascent h3 { font-size: 25px; }
  .ascent .desc { font-size: 13.5px; line-height: 1.6; }
  /* Expertise: the section label at the top, the pillar's panel at the bottom, the temple between them */
  #skills .sticky { height: 100svh; justify-content: space-between; padding: 76px 0 76px; }
  #skills .sticky .col { display: flex; flex-direction: column; height: 100%; }
  #skills .lede, #skills h2 { display: none; } /* (the eyebrow names the section; the temple needs the room) */
  .pillar-index { margin-top: auto; gap: 16px; }
  .pillar { margin-top: 16px; padding-left: 16px; }
  .pillar h3 { font-size: 23px; }
  .pillar ul { margin-top: 12px; gap: 9px; }
  .pillar li span { font-size: 12.5px; line-height: 1.5; }
  /* Contact: at the bottom, under the island */
  #contact.screen { min-height: 100svh; align-items: flex-end; padding-bottom: 96px; }
}

/* ---- phones held sideways: little height, so smaller type and a compact Expertise panel ---- */
@media (max-height: 500px) and (orientation: landscape) {
  h2 { font-size: 30px; }
  .eyebrow { margin-bottom: 10px; }
  #projects { padding: 22vh 0 20vh; }
  #projects h2 { font-size: 24px; }
  .ascent li { min-height: 80vh; }
  .ascent h3 { font-size: 22px; margin: 6px 0 2px; }
  .ascent .desc { margin-top: 8px; font-size: 12.5px; line-height: 1.5; }
  #skills .sticky { padding-top: 64px; }
  #skills .lede { display: none; }
  #skills h2 { font-size: 24px; }
  .pillar-index { margin-top: 12px; }
  .pillar { margin-top: 10px; max-width: 34em; }
  .pillar h3 { font-size: 20px; }
  .pillar ul { margin-top: 8px; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
  .pillar li span { font-size: 11.5px; line-height: 1.4; }
  #contact h2 { font-size: 30px; }
}
