/* Ouahiba Boudiaf, poet
   Tottenham x Algiers. Alger la Blanche whites and Mediterranean blue,
   warmed by North London brick. Quiet, spacious, reverent.
   The poem is always the star. */

:root {
  --paper: #f7f4ec;        /* Alger la Blanche, warm off-white */
  --paper-deep: #efe9db;   /* faint tonal shift */
  --ink: #1e1c19;          /* ink black */
  --ink-soft: #514c45;     /* muted text */
  --blue: #17566b;         /* Mediterranean / Casbah blue */
  --blue-deep: #0f3d4d;
  --brick: #9d4a2e;        /* Tottenham brick terracotta, used sparingly */
  --rule: rgba(23, 86, 107, 0.22);
  --measure: 34rem;

  --serif-display: "Cormorant Garamond", Georgia, serif;
  --serif-text: "EB Garamond", Georgia, serif;
  --arabic: "Amiri", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 1.18rem;
  line-height: 1.75;
  font-feature-settings: "liga" 1, "clig" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- shell ---- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.6rem;
}

.site-head {
  padding: 3.4rem 0 0;
  text-align: center;
}

/* ---- language toggle ---- */
.lang-toggle {
  text-align: center;
  margin-bottom: 2.2rem;
}
.lang-toggle button {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--serif-text);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.15rem 0.2rem;
  transition: color 0.25s ease;
}
.lang-toggle button:hover { color: var(--blue); }
.lang-toggle button[aria-pressed="true"] { color: var(--brick); }
.lang-toggle .sep { color: var(--rule); margin: 0 0.4rem; }

/* keep English/French poem bodies left-to-right even under Arabic chrome */
[dir="rtl"] article.poem:not([lang="ar"]) { direction: ltr; }
[dir="rtl"] article.poem:not([lang="ar"]) .verse { text-align: left; }
[dir="rtl"] .prose p.first::first-letter {
  float: right;
  padding: 0.3rem 0 0 0.6rem;
}

.site-head a.wordmark {
  display: inline-block;
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
}

.site-head .role {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--blue);
  font-family: var(--serif-text);
}

nav.main {
  margin-top: 1.9rem;
  text-align: center;
}

nav.main a {
  display: inline-block;
  margin: 0 0.95rem;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

nav.main a:hover { color: var(--blue); }
nav.main a[aria-current="page"] {
  color: var(--brick);
  border-bottom-color: var(--brick);
}

/* ---- the zellige star, faint ---- */

.ornament {
  display: block;
  margin: 3rem auto;
  width: 32px;
  height: 32px;
  opacity: 0.55;
  color: var(--blue);
}
.ornament svg { width: 100%; height: 100%; display: block; }
.ornament rect, .ornament path, .ornament circle {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

hr.rule {
  border: 0;
  height: 1px;
  background: var(--rule);
  max-width: 8rem;
  margin: 3rem auto;
}

/* ---- home ---- */

.home {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 0 2rem;
}

.home .lede {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 1.35;
  color: var(--ink);
  margin: 0 auto;
  max-width: 26rem;
}

.home .lede .soft { color: var(--ink-soft); font-style: italic; }

.home .enter {
  margin-top: 2.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.3rem;
}
.home .enter:hover { color: var(--brick); border-bottom-color: var(--brick); }

/* ---- poems index ---- */

.page-title {
  text-align: center;
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: 0.03em;
  margin: 3.2rem 0 0.4rem;
}

.page-sub {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1.02rem;
  margin: 0 0 1rem;
}

ol.contents {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 4rem;
}

ol.contents li { margin: 0; }

ol.contents a {
  display: block;
  text-align: center;
  padding: 1.15rem 0;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  transition: background 0.25s ease;
}
ol.contents li:first-child a { border-top: 1px solid var(--rule); }
ol.contents a:hover { background: var(--paper-deep); }

ol.contents .t {
  font-family: var(--serif-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--blue-deep);
}
ol.contents a:hover .t { color: var(--brick); }

ol.contents .m {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- the constellation (rhizomatic map) ---- */

.sky-wrap {
  /* full-bleed: span the viewport, centred, RTL-safe */
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-top: 2.4rem;
  margin-bottom: 1rem;
}
.constellation {
  width: 94%;
  max-width: 1180px;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}
.constellation .threads line {
  stroke: var(--blue);
  stroke-width: 1;
  opacity: 0.20;
}
.constellation .dust circle {
  fill: var(--blue);
  opacity: 0.16;
}
.constellation .node { cursor: pointer; }
.constellation .node use {
  fill: var(--blue);
  transition: fill 0.3s ease, transform 0.3s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.constellation .node text {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 31px;
  fill: var(--ink);
  transition: fill 0.3s ease;
}
.constellation .node:hover use,
.constellation .node:focus-visible use {
  fill: var(--brick);
  transform: scale(1.25);
}
.constellation .node:hover text,
.constellation .node:focus-visible text { fill: var(--brick); }

.plain-index {
  text-align: center;
  margin: 1.4rem auto 3.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 2;
  max-width: 30rem;
}
.plain-index a { color: var(--ink-soft); text-decoration: none; }
.plain-index a:hover { color: var(--blue); }
.plain-index .dot { color: var(--rule); margin: 0 0.5rem; }

/* threads leading out of a poem */
.threads-out {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 3.4rem;
}
.threads-out a {
  font-style: italic;
  font-size: 1.08rem;
  color: var(--blue);
  text-decoration: none;
}
.threads-out a:hover { color: var(--brick); }

/* ---- a single poem ---- */

.poem-page { padding-top: 1rem; }

.backlink {
  display: block;
  text-align: center;
  margin-top: 2.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}
.backlink:hover { color: var(--blue); }

article.poem {
  margin: 3.5rem auto 2rem;
  max-width: 30rem;
}

article.poem h1 {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 2.2rem;
  line-height: 1.2;
  text-align: center;
  margin: 0 0 0.5rem;
  letter-spacing: 0.01em;
}

article.poem .byline {
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 2.6rem;
}

.verse {
  font-size: 1.24rem;
  line-height: 1.95;
}

.verse .stanza { margin: 0 0 1.9rem; }
.verse .stanza:last-child { margin-bottom: 0; }
.verse .spoken { font-style: italic; }

/* Arabic poems: right to left, calligraphic face */
[lang="ar"] { direction: rtl; }
article.poem[lang="ar"] .verse,
.verse[lang="ar"] {
  font-family: var(--arabic);
  direction: rtl;
  text-align: right;
  font-size: 1.5rem;
  line-height: 2.2;
}
article.poem[lang="ar"] h1 { font-family: var(--arabic); }

/* French keeps the Latin serif, subtle marker only */

/* ---- about ---- */

.prose {
  margin: 3rem auto 2rem;
}
.prose h1 {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 2rem;
  text-align: center;
  margin: 0 0 2rem;
}
.prose p { margin: 0 0 1.3rem; }
.prose h2 {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 1.5rem;
  text-align: center;
  color: var(--blue-deep);
  margin: 0 0 1.4rem;
}
.prose .links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 0;
}
.prose .links a {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--blue);
  text-decoration: none;
}
.prose .links a:hover { color: var(--brick); }
.prose p.first::first-letter {
  font-family: var(--serif-display);
  font-size: 3.1rem;
  line-height: 0.8;
  float: left;
  padding: 0.3rem 0.6rem 0 0;
  color: var(--brick);
}
.portrait {
  display: block;
  width: 190px;
  height: 190px;
  margin: 0 auto 2.2rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-deep);
}
.portrait-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  border: 1px solid var(--rule);
}

/* ---- stay in touch, quiet ---- */

.keep {
  text-align: center;
  margin: 4rem auto 0;
  max-width: 24rem;
}
.keep p {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1rem;
}

/* ---- footer ---- */

footer.site-foot {
  text-align: center;
  padding: 4rem 0 3rem;
  color: var(--ink-soft);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}
footer.site-foot .name {
  font-family: var(--serif-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--ink);
}

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

@media (max-width: 480px) {
  body { font-size: 1.1rem; }
  nav.main a { margin: 0 0.55rem; font-size: 0.72rem; letter-spacing: 0.2em; }
  .verse { font-size: 1.16rem; }
}
