/* levantnoir.scot: direction B "Shore"
   Paper ground, Newsreader for reading, Instrument Sans for labels, Plex Mono for method lines.
   One committed light look; every colour is a token below. */

:root {
  --paper: #f4efe6;
  --paper-tint: #ece5d6;
  --ink: #1f1b18;
  --ink-soft: #4a423d;
  --muted: #736a61;
  --rule: #dcd3c4;
  --rule-subtle: rgba(31, 27, 24, 0.09);
  --rust: #b25329;
  --rust-deep: #8a3a16;
  --copper: #b25329;
  --copper-deep: #8a3a16;
  --copper-glow: rgba(178, 83, 41, 0.16);
  --verdigris: #556c63;
  --dark: #1b1816;
  --dark-ink: #efe7dd;
  --dark-muted: #9e9588;
  --dark-accent: #d9824c;
  --chamber: #171513;
  --chamber-paper: #ede7dd;
  --chamber-muted: #9e9588;
  --chamber-rule: rgba(237, 231, 221, 0.12);
  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', Menlo, Consolas, monospace;
  --gutter: clamp(24px, 5.5vw, 80px);
  --measure: 60ch;
  --max-width: 1360px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'opsz' 18;
}
body.has-player { padding-bottom: 96px; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--rust-deep); }
:focus-visible { outline: 2px solid var(--rust-deep); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { margin: 0; font-weight: 300; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: italic; }
svg { display: block; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 14px;
}
.skip:focus { top: 16px; }

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

.label {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.meta, .note {
  font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meta a { text-decoration: underline; text-underline-offset: 3px; }
.body { font-family: var(--sans); font-size: 15px; line-height: 1.6; color: var(--ink-soft); max-width: var(--measure); }
.wt { font-style: italic; color: var(--muted); }

/* Hero */
.hero {
  position: relative;
  height: clamp(480px, 64vw, 720px);
  color: var(--dark-ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px var(--gutter) clamp(28px, 4.5vw, 48px);
  isolation: isolate;
}
.hero__picture, .hero__picture img {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero__picture img { object-fit: cover; object-position: 50% 55%; z-index: -2; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(20, 18, 16, 0.52) 0%, rgba(20, 18, 16, 0.18) 28%, transparent 52%),
    linear-gradient(to top, rgba(20, 18, 16, 0.75) 0%, rgba(20, 18, 16, 0.28) 45%, transparent 72%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.18 0 0 0 0 0.16 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.hero__nav {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: 0.08em;
}
.hero__site, .hero__links a {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.hero__status {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--dark-ink); text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dark-accent);
  box-shadow: 0 0 10px rgba(217, 130, 76, 0.9);
  animation: pulse-dot 2.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}
.hero__links { display: flex; gap: clamp(14px, 2.4vw, 28px); flex-wrap: wrap; justify-content: flex-end; }
.hero__nav a:hover { color: var(--dark-accent); }
.hero__name h1 {
  font-size: clamp(64px, 9.5vw, 128px); line-height: 0.92; letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 72;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.hero__role {
  margin-top: 16px; font-family: var(--sans); font-size: 13px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dark-ink); font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Sections */
.sec {
  padding: 0 var(--gutter);
  margin-top: clamp(64px, 8vw, 112px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 28px;
  row-gap: 32px;
}
.sec__aside { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: 12px; }
.sec__main { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 24px; }
.sec__side { grid-column: 10 / span 3; display: flex; flex-direction: column; gap: 12px; }
.sec__title { font-size: 30px; font-variation-settings: 'opsz' 30; }
.sec__title--large { font-size: clamp(26px, 2.4vw, 34px); font-variation-settings: 'opsz' 34; }

.statement {
  grid-column: 1 / span 7;
  font-size: clamp(28px, 2.9vw, 42px); line-height: 1.25; font-weight: 300;
  font-variation-settings: 'opsz' 36; text-wrap: pretty;
}
.first { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 14px; padding-top: 10px; }
.first__row { display: flex; align-items: center; gap: 14px; }
.first__title { font-size: 24px; line-height: 1.1; }

.play {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  transition: all 0.25s ease;
}
.play svg { fill: currentColor; }
.play .icon-pause { display: none; }
.play[aria-pressed="true"] .icon-play { display: none; }
.play[aria-pressed="true"] .icon-pause { display: block; }
.play:hover { border-color: var(--rust); color: var(--rust); transform: scale(1.05); }
.play--accent { width: 52px; height: 52px; background: var(--rust); border-color: var(--rust); color: var(--paper); }
.play--accent:hover { background: var(--rust-deep); border-color: var(--rust-deep); color: var(--paper); }
.play--pending { border-style: dashed; border-color: #a49a8a; cursor: default; }

/* Listening room */
.tracks { grid-column: 4 / span 9; display: flex; flex-direction: column; border-bottom: 1px solid var(--rule-subtle); }
.track {
  display: grid; grid-template-columns: 32px 44px 1.8fr 1.1fr 0.7fr; gap: 20px; align-items: start;
  padding: 22px 0; border-top: 1px solid var(--rule-subtle);
  transition: background 0.25s ease;
}
.track__idx { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; padding-top: 14px; }
.track__body { display: flex; flex-direction: column; gap: 6px; }
.track__title { font-size: 24px; font-variation-settings: 'opsz' 24; display: inline-flex; align-items: center; }
.track-wave {
  display: none; align-items: flex-end; gap: 2px; height: 12px; margin-left: 10px; vertical-align: middle;
}
.track.is-playing .track-wave { display: inline-flex; }
.wave-bar {
  width: 2px; background: var(--rust); border-radius: 1px;
  animation: wave-bounce 1.2s ease-in-out infinite alternate;
}
.wave-bar:nth-child(1) { height: 4px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 12px; animation-delay: 0.25s; }
.wave-bar:nth-child(3) { height: 7px; animation-delay: 0.45s; }
@keyframes wave-bounce {
  0% { height: 3px; }
  100% { height: 13px; }
}
.track__desc { font-family: var(--sans); font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.track__method { font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--muted); padding-top: 6px; }
.track__tech { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: var(--muted); padding-top: 6px; }
.track__tech summary { cursor: pointer; font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust-deep); list-style: none; user-select: none; }
.track__tech summary::-webkit-details-marker { display: none; }
.track__tech summary::before { content: '+ '; font-family: var(--mono); }
.track__tech[open] summary::before { content: '− '; }
.track__tech p { margin-top: 6px; }
.track__meta { font-family: var(--sans); font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; padding-top: 6px; white-space: nowrap; }
.track.is-playing .track__title { color: var(--rust); }

/* Performance */
.figure { grid-column: 1 / span 4; margin: 0; position: relative; }
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 10px; }
.list { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule-subtle); }
.list__row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 14px 0; border-top: 1px solid var(--rule-subtle); font-size: 20px; }

/* Writing Chamber - Nocturne */
.sec-chamber {
  margin-top: clamp(72px, 9vw, 120px);
  background: var(--chamber);
  color: var(--chamber-paper);
  padding: clamp(64px, 8vw, 112px) var(--gutter);
  border-top: 1px solid rgba(178, 83, 41, 0.25);
  border-bottom: 1px solid rgba(178, 83, 41, 0.25);
  position: relative;
}
.sec-chamber::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.chamber__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px; row-gap: 36px; max-width: var(--max-width); margin: 0 auto;
  position: relative; z-index: 1;
}
.chamber__aside { grid-column: 1 / span 4; display: flex; flex-direction: column; gap: 14px; }
.chamber__lead { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 28px; }
.chamber__quote {
  font-size: clamp(22px, 2.3vw, 32px); line-height: 1.35; font-weight: 300;
  color: var(--chamber-paper); font-style: italic; letter-spacing: -0.01em;
}
.chamber__meta {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--dark-accent); text-transform: uppercase;
}
.chamber__body {
  font-family: var(--sans); font-size: 15px; line-height: 1.65;
  color: var(--chamber-muted); max-width: 56ch;
}
.chamber__action { display: flex; align-items: center; gap: 24px; padding-top: 10px; }
.chamber__btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px; background: var(--copper); color: var(--chamber-paper);
  font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: 0.04em;
  border-radius: 2px; transition: all 0.25s ease;
}
.chamber__btn:hover {
  background: var(--copper-deep); color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 16px var(--copper-glow);
}

/* About */
.bio { grid-column: 4 / span 8; display: flex; flex-direction: column; gap: 18px; max-width: 68ch; }
.bio p { font-size: clamp(17px, 1.25vw, 19.5px); line-height: 1.65; font-weight: 300; color: var(--ink-soft); }

/* Enquiries */
.contact__content {
  grid-column: 4 / span 9;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}
.contact__intro {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 24px;
  max-width: var(--measure);
}
.enquiries {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 3.5vw, 48px);
}
.enq {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0;
  border-top: 1px solid var(--rule-subtle);
  font-size: clamp(18px, 1.4vw, 20px);
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
.enq > a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--rule);
  overflow-wrap: break-word;
  word-break: break-word;
}
.enq > a:hover { text-decoration-color: currentColor; }
.enq:nth-last-child(-n+2) { border-bottom: 1px solid var(--rule-subtle); }

.footer {
  margin: clamp(64px, 8vw, 112px) var(--gutter) 40px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 32px;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--rule-subtle);
  padding-top: 24px;
}

/* Persistent player */
.player {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px 10px 12px;
  background: rgba(23, 21, 19, 0.92);
  color: var(--chamber-paper);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--sans); font-size: 13px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.player[hidden] { display: none; }
.player__toggle, .player__stop {
  background: transparent; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0;
}
.player__toggle { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: rgba(239, 233, 221, 0.1); }
.player__toggle svg { fill: currentColor; }
.player__toggle .icon-play { display: none; }
.player.is-paused .player__toggle .icon-play { display: block; }
.player.is-paused .player__toggle .icon-pause { display: none; }
.player__title { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__time { flex: none; font-variant-numeric: tabular-nums; color: var(--dark-muted); }
.player__progress { flex: 1 1 80px; height: 1px; background: #6b6259; position: relative; }
.player__bar { position: absolute; left: 0; top: -1px; height: 3px; width: 0%; background: var(--rust); }
.player__link { flex: none; color: var(--dark-muted); text-decoration: underline; text-underline-offset: 3px; }
.player__link:hover { color: var(--dark-ink); }
.player__stop { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(239, 233, 221, 0.35); }
.player__stop:hover { border-color: var(--dark-ink); }
.player.is-failed .player__progress, .player.is-failed .player__time, .player.is-failed .player__toggle { display: none; }
.player.is-failed .player__title { white-space: normal; flex: 1 1 auto; max-width: none; }
.player.is-failed .player__link { display: inline; color: var(--dark-ink); }
.player.is-failed { border-radius: 20px; }
.sc-host { position: absolute; width: 1px; height: 1px; overflow: hidden; left: -9999px; top: 0; }
.sc-host iframe { width: 300px; height: 80px; border: 0; }

/* Phone and small tablet */
@media (max-width: 899px) {
  .sec, .wudd { display: flex; flex-direction: column; gap: 20px; }
  .statement { font-size: clamp(26px, 6.8vw, 34px); }
  .first { padding-top: 8px; }
  .sec__aside, .sec__main, .sec__side, .figure, .tracks, .essays, .bio, .contact__content, .enquiries { width: 100%; min-width: 0; }
  .sec__title { font-size: 26px; }
  .chamber__grid { display: flex; flex-direction: column; gap: 24px; }
  .chamber__aside, .chamber__lead { width: 100%; }
  .track { grid-template-columns: 28px 44px 1fr; gap: 12px 14px; }
  .track__desc { grid-column: 3; }
  .track__method, .track__tech { grid-column: 3; padding-top: 0; }
  .track__meta { grid-column: 3; text-align: left; padding-top: 0; white-space: normal; }
  .figure img { max-height: 420px; object-fit: cover; }
  .contact__content { width: 100%; min-width: 0; }
  .enquiries { display: flex; flex-direction: column; width: 100%; }
  .enq { font-size: 19px; width: 100%; }
  .enq:nth-last-child(-n+2) { border-bottom: 0; }
  .enq:last-child { border-bottom: 1px solid var(--rule-subtle); }
  .hero__links { gap: 14px; }
  .hero__status { display: none; }
  .player { left: 12px; right: 12px; bottom: 12px; gap: 10px; }
  .player__link { display: none; }
}
@media (max-width: 480px) {
  .hero__site { display: none; }
  .hero__nav { justify-content: flex-start; }
  .hero__links { justify-content: flex-start; gap: 14px; font-size: 13px; }
  .hero__picture img { object-position: 30% 55%; }
  .hero::before {
    background:
      linear-gradient(to bottom, rgba(20, 18, 16, 0.5) 0%, rgba(20, 18, 16, 0.15) 26%, transparent 48%),
      linear-gradient(to top, rgba(43, 38, 34, 0.72) 0%, rgba(43, 38, 34, 0.25) 50%, transparent 72%);
  }
  .player__title { max-width: 38vw; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .hero { height: auto; color: var(--ink); padding: 0 0 24px; }
  .hero__picture, .hero::before, .hero::after, .player, .sc-host, .skip, .play { display: none; }
  .hero__nav { display: none; }
  .sec, .wudd { display: block; margin-top: 32px; padding: 0; }
  .wudd { background: transparent; color: var(--ink); }
  .wudd__body, .wudd__note { color: var(--muted); }
  .label--wudd { color: var(--muted); }
  .enq > a::after { content: " (" attr(href) ")"; font-family: var(--sans); font-size: 12px; color: var(--muted); }
  .track { grid-template-columns: 1.6fr 1.3fr 0.7fr; }
  .track .play { display: none; }
}
