/* Petar Anastasov — Personal poetry & art site
   Aesthetic: gallery / museum, warm cream paper, ink black, generous whitespace
*/

:root {
  --paper: #f3ede0;
  --paper-2: #ebe3d1;
  --ink: #1a1814;
  --ink-soft: #4a4438;
  --ink-mute: #8a8170;
  --rule: #cfc4ad;
  --accent: #6b3a1f; /* burnt sienna ink */
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --hand: 'Caveat', 'Homemade Apple', cursive;
  --sans: 'Inter Tight', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

img { display: block; max-width: 100%; }

/* paper grain — subtle SVG noise */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
  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.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.18  0 0 0 0 0.13  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

#root { position: relative; z-index: 1; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 36px 64px 28px;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 100;
}
.brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.brand .brand-sub {
  font-family: var(--hand);
  font-size: 18px;
  color: var(--ink-mute);
  margin-left: 10px;
  font-style: italic;
}
.nav {
  display: flex;
  gap: 36px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav button {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}
.nav button:hover { color: var(--ink); }
.nav button.active { color: var(--ink); }
.nav button.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--ink);
}

/* ---------- generic page frame ---------- */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 64px 160px;
}
.page-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 48px 160px;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
}

h1.display {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 88px;
  line-height: 0.95;
  margin: 0 0 36px;
  letter-spacing: -0.01em;
}
h2.section {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 42px;
  line-height: 1.1;
  margin: 0 0 24px;
}
.lede {
  font-size: 22px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 640px;
  font-weight: 300;
}

/* ---------- featured (homepage hero poem) ---------- */
.featured-wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 80px;
  align-items: center;
  margin-top: 48px;
}
.featured-img {
  aspect-ratio: 4/5;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.featured-img .placeholder-svg {
  width: 100%; height: 100%;
}
.featured-text .featured-tag {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}
.featured-text h2 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 72px;
  line-height: 1;
  margin: 0 0 32px;
  color: var(--ink);
}
.featured-text .poem-preview {
  font-size: 21px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--ink-soft);
  margin-bottom: 40px;
  font-weight: 300;
}
.featured-text .read-more {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  display: inline-block;
}

/* ---------- poem index list ---------- */
.poem-index {
  margin-top: 48px;
  border-top: 1px solid var(--rule);
}
.poem-row {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 32px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.3s, padding 0.3s;
}
.poem-row:hover {
  background: rgba(107, 58, 31, 0.04);
  padding-left: 16px;
  padding-right: 16px;
}
.poem-row .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}
.poem-row .title {
  font-family: var(--hand);
  font-size: 36px;
  line-height: 1;
  color: var(--ink);
}
.poem-row .excerpt {
  font-style: italic;
  font-size: 17px;
  color: var(--ink-mute);
  max-width: 440px;
  line-height: 1.4;
}
.poem-row .has-img {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.poem-row .arrow {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ink-mute);
  transition: transform 0.3s, color 0.3s;
}
.poem-row:hover .arrow { transform: translateX(8px); color: var(--ink); }

/* ---------- single poem view ---------- */
.poem-view {
  max-width: 920px;
  margin: 0 auto;
  padding: 64px 48px 160px;
}
.poem-view .back {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 64px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.poem-view .back:hover { color: var(--ink); }

.poem-header {
  margin-bottom: 56px;
  text-align: center;
}
.poem-header h1 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 96px;
  line-height: 1;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.poem-header .subtitle {
  font-style: italic;
  color: var(--ink-mute);
  font-size: 18px;
}

.poem-art {
  margin: 0 -32px 64px;
  aspect-ratio: 16/10;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}

.poem-body {
  font-size: 22px;
  line-height: 1.85;
  white-space: pre-wrap;
  text-align: center;
  font-weight: 400;
  color: var(--ink);
  font-feature-settings: "liga", "dlig";
  max-width: 640px;
  margin: 0 auto;
}

.poem-signature {
  text-align: center;
  margin-top: 56px;
  font-family: var(--hand);
  font-size: 28px;
  color: var(--ink-soft);
}
.poem-signature .date {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 16px;
}

.poem-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 120px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.poem-nav button:hover { color: var(--ink); }
.poem-nav .nav-title {
  font-family: var(--hand);
  font-size: 22px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  display: block;
  margin-top: 4px;
}

/* ---------- songs ---------- */
.song-list {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.song-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 32px;
  background: rgba(255, 253, 247, 0.5);
  border: 1px solid var(--rule);
  align-items: center;
}
.song-cover {
  aspect-ratio: 1;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.song-meta .tag {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.song-meta h3 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
  margin: 0 0 8px;
}
.song-meta .sub {
  font-style: italic;
  color: var(--ink-mute);
  font-size: 17px;
  margin-bottom: 24px;
}

/* custom audio player */
.player {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  margin-top: 16px;
}
.player .play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.player .play-btn:hover { transform: scale(1.05); }
.player .play-btn svg { width: 18px; height: 18px; }
.player .progress {
  flex: 1;
  height: 2px;
  background: var(--rule);
  position: relative;
  cursor: pointer;
}
.player .progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--ink);
  transition: width 0.1s linear;
}
.player .progress-knob {
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
}
.player .time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  min-width: 80px;
  text-align: right;
}
.player .source {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-left: 1px solid var(--rule);
  padding-left: 16px;
}

/* ---------- book section ---------- */
.book-hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 96px;
  align-items: center;
  margin-top: 48px;
}
.book-mockup {
  aspect-ratio: 3/4;
  background: var(--paper-2);
  position: relative;
  box-shadow:
    -2px 0 0 var(--rule),
    -10px 18px 40px rgba(26, 24, 20, 0.18);
}
.book-mockup::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 18px;
  background: linear-gradient(90deg, rgba(0,0,0,0.18), transparent);
}
.book-mockup-content {
  position: absolute;
  inset: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.book-mockup-content .top {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.book-mockup-content .mid h3 {
  font-family: var(--hand);
  font-size: 56px;
  line-height: 1;
  margin: 0 0 16px;
  color: var(--ink);
  font-weight: 400;
}
.book-mockup-content .mid p {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0;
}
.book-mockup-content .bottom {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}

.book-text .eyebrow { color: var(--accent); }
.book-text h2 {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 72px;
  line-height: 1;
  margin: 0 0 24px;
}
.book-text p {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 480px;
}

.notify-form {
  margin-top: 36px;
  display: flex;
  border-bottom: 1px solid var(--ink);
  max-width: 420px;
}
.notify-form input {
  flex: 1;
  background: transparent;
  border: 0;
  font-family: var(--serif);
  font-size: 18px;
  padding: 14px 0;
  color: var(--ink);
  outline: none;
  font-style: italic;
}
.notify-form input::placeholder { color: var(--ink-mute); }
.notify-form button {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 14px 0 14px 16px;
  color: var(--ink);
}
.notify-form button:hover { color: var(--accent); }

.notify-thanks {
  font-family: var(--hand);
  font-size: 24px;
  color: var(--accent);
  margin-top: 24px;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 96px;
  margin-top: 48px;
  align-items: start;
}
.portrait {
  aspect-ratio: 4/5;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.about-text p {
  font-size: 20px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 24px;
  max-width: 560px;
  font-weight: 300;
}
.about-text .pull {
  font-family: var(--hand);
  font-size: 36px;
  line-height: 1.15;
  color: var(--accent);
  margin: 48px 0;
  max-width: 480px;
}

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 96px;
  margin-top: 48px;
}
.contact-info p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 440px;
}
.contact-info .label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: block;
  margin-bottom: 6px;
}
.contact-info .value {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  display: block;
  margin-bottom: 32px;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.contact-form .field input,
.contact-form .field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  outline: none;
  resize: none;
}
.contact-form .field input:focus,
.contact-form .field textarea:focus {
  border-bottom-color: var(--ink);
}
.contact-form .field label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: block;
  margin-bottom: 4px;
}
.contact-form .submit {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 14px 32px;
  margin-top: 12px;
  transition: background 0.2s, color 0.2s;
}
.contact-form .submit:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 40px 64px;
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- placeholder SVG element ---------- */
.placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(
      135deg,
      var(--paper-2) 0px,
      var(--paper-2) 24px,
      rgba(207, 196, 173, 0.45) 24px,
      rgba(207, 196, 173, 0.45) 25px
    );
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.placeholder span {
  background: var(--paper);
  padding: 6px 12px;
  border: 1px solid var(--rule);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .site-header { padding: 24px 28px; flex-direction: column; gap: 16px; align-items: flex-start; }
  .nav { gap: 20px; flex-wrap: wrap; }
  .page, .page-narrow { padding: 48px 28px 100px; }
  .featured-wrap, .book-hero, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  h1.display { font-size: 64px; }
  .featured-text h2 { font-size: 56px; }
  .poem-row { grid-template-columns: 40px 1fr auto; gap: 16px; }
  .poem-row .excerpt { display: none; }
  .poem-header h1 { font-size: 64px; }
  .poem-body { font-size: 19px; }
  .song-card { grid-template-columns: 1fr; }
  .site-footer { padding: 24px 28px; flex-direction: column; gap: 12px; }
}

/* ---------- typography variants (tweaks) ---------- */
body[data-font="modern"] {
  --serif: 'Newsreader', 'Lora', Georgia, serif;
  --hand: 'Caveat', cursive;
}
body[data-font="classic"] {
  --serif: 'EB Garamond', Georgia, serif;
  --hand: 'Homemade Apple', cursive;
}
body[data-font="literary"] {
  --serif: 'Cormorant Garamond', Georgia, serif;
  --hand: 'Caveat', cursive;
}

body[data-palette="cream"] {
  --paper: #f3ede0;
  --paper-2: #ebe3d1;
  --rule: #cfc4ad;
}
body[data-palette="white"] {
  --paper: #fafaf7;
  --paper-2: #f1f1ec;
  --rule: #d8d8d2;
  --accent: #9a3a1f;
}
body[data-palette="sepia"] {
  --paper: #ede2cb;
  --paper-2: #ddcfb2;
  --rule: #b9a884;
  --ink: #2a200f;
  --ink-soft: #5a4a2c;
  --ink-mute: #8b7a55;
}
body[data-palette="dark"] {
  --paper: #15140f;
  --paper-2: #21201a;
  --rule: #36342a;
  --ink: #ece6d4;
  --ink-soft: #c0b9a3;
  --ink-mute: #7d7560;
  --accent: #d29464;
}
body[data-palette="dark"]::before { opacity: 0.2; mix-blend-mode: screen; }

/* density */
body[data-density="airy"] .page { padding: 120px 64px 200px; }
body[data-density="airy"] .featured-wrap { gap: 120px; }
body[data-density="compact"] .page { padding: 48px 64px 100px; }
body[data-density="compact"] .featured-wrap { gap: 48px; }
