/* ==========================================================
   Dimitrios Rentel — project diary
   Palette is taken from the Pascha photo: aubergine night sky,
   gold of the cross, magenta of the fireworks.
   ========================================================== */

:root {
  --night: #170c1c;
  --night-deep: #10081a;
  --panel: #21122b;
  --line: #3b2546;
  --gold: #c9a44f;
  --gold-soft: #e0c27a;
  --gold-deep: #8f7433;
  --ember: #d9528f;
  --bone: #f0e7df;
  --mute: #b5a7ba;

  --display: "Alegreya", "Iowan Old Style", Georgia, serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

  --nav-h: 4.25rem;
  --wrap: 68rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--gold-soft); text-underline-offset: 0.2em; }
a:hover { color: var(--bone); }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--gold);
  color: var(--night);
  padding: 0.6rem 1rem;
  font-weight: 600;
  z-index: 100;
}
.skip:focus { top: 0.75rem; }

/* ---------- Navigation ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(23, 12, 28, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  min-height: var(--nav-h);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
  color: var(--bone);
  text-decoration: none;
}
.brand:hover { color: var(--gold-soft); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--bone);
  font: inherit;
  font-size: 1rem;
  padding: 0.45rem 0.9rem;
  border-radius: 3px;
  cursor: pointer;
}

.menu,
.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.menu a {
  color: var(--mute);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 500;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}
.menu a:hover { color: var(--bone); }
.menu a[aria-current="page"] {
  color: var(--bone);
  border-bottom-color: var(--gold);
}

.has-sub {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.sub-toggle {
  background: none;
  border: 0;
  color: var(--mute);
  cursor: pointer;
  padding: 0.4rem 0.35rem;
  line-height: 1;
  font-size: 0.8rem;
}
.sub-toggle:hover { color: var(--bone); }
.sub-toggle[aria-expanded="true"] { color: var(--gold-soft); }

.sub {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  padding: 0.4rem 0;
  display: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.has-sub.open .sub { display: block; }
@media (hover: hover) {
  .has-sub:hover .sub { display: block; }
}

.sub a {
  display: block;
  padding: 0.7rem 1.25rem;
  border-bottom: 0;
  color: var(--bone);
}
.sub a:hover { background: var(--night); color: var(--gold-soft); }
.sub a[aria-current="page"] { color: var(--gold-soft); }

@media (max-width: 52rem) {
  .menu-toggle { display: inline-block; }

  .menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--night);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.25rem;
  }
  .menu.open { display: flex; }
  .menu > li { border-bottom: 1px solid var(--line); }
  .menu > li:last-child { border-bottom: 0; }
  .menu a { display: block; padding: 0.85rem 0; border-bottom: 0; }
  .menu a[aria-current="page"] { color: var(--gold-soft); }

  .has-sub { flex-wrap: wrap; }
  .has-sub > a { flex: 1; }
  .sub-toggle { display: none; }

  .sub {
    position: static;
    display: block;
    flex-basis: 100%;
    min-width: 0;
    background: none;
    border: 0;
    border-left: 2px solid var(--gold-deep);
    box-shadow: none;
    padding: 0;
    margin: 0 0 0.75rem 0.25rem;
  }
  .sub a { padding: 0.6rem 1rem; }
  .sub a:hover { background: none; }
}

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--night-deep);
}

.hero-media {
  position: absolute;
  inset: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 8%;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(23, 12, 28, 0.97) 0%, rgba(23, 12, 28, 0.88) 30%, rgba(23, 12, 28, 0.28) 62%, rgba(23, 12, 28, 0.28) 100%);
}

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

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.3rem, 4.2vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.hero p {
  font-size: 1.2rem;
  max-width: 34rem;
  margin: 0 0 1.75rem;
  color: var(--bone);
}
.hero p.hero-note { color: var(--bone); }

.hero .rule {
  width: 4.5rem;
  height: 3px;
  background: var(--gold);
  margin: 0 0 1.5rem;
  border: 0;
}

/* Text sits in the lower right so the cross and the burst stay clear. */
.hero-text { margin-left: auto; max-width: 31rem; }

/* One entrance for the hero copy, nothing else moves on its own. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: rise 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both 150ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(1.25rem); }
    to { opacity: 1; transform: none; }
  }
}

@media (max-width: 52rem) {
  .hero {
    display: block;
    min-height: 0;
    background: var(--night);
  }
  .hero-media {
    position: relative;
    height: 62svh;
    min-height: 22rem;
  }
  .hero-media img { object-position: 50% 20%; }
  .hero-media::after {
    background: linear-gradient(to top, var(--night) 0%, rgba(23, 12, 28, 0) 55%);
  }
  .hero-copy {
    margin-top: -5rem;
    padding-bottom: 3.5rem;
  }
  .hero-text { margin-left: 0; max-width: 34rem; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--gold);
  color: var(--night);
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  border: 1px solid var(--gold);
  border-radius: 2px;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.btn:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--night); }

.btn-quiet {
  background: transparent;
  color: var(--gold-soft);
  border-color: var(--gold-deep);
}
.btn-quiet:hover { background: var(--panel); color: var(--bone); border-color: var(--gold); }

/* ---------- Inner pages ---------- */

.page-head {
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to right, rgba(23, 12, 28, 0.96) 15%, rgba(23, 12, 28, 0.55) 100%),
    url("pascha.jpg") 60% 24% / cover no-repeat;
}
.page-head .wrap {
  padding-top: 4.5rem;
  padding-bottom: 3.25rem;
}
.page-head h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}

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

main.inner { padding-bottom: 5rem; }

.lede {
  font-size: 1.22rem;
  max-width: 40rem;
  margin: 3rem 0 0;
  color: var(--bone);
}

.prose {
  max-width: 40rem;
  margin: 3rem 0 0;
}
.prose p { margin: 0 0 1.25rem; }
.prose p:last-child { margin-bottom: 0; }

h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 0.35rem;
}

/* ---------- Document slots (PDFs) ---------- */

.docs { margin-top: 2.5rem; border-top: 1px solid var(--line); }

.doc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.75rem 0 1.75rem 1.5rem;
  border-bottom: 1px solid var(--line);
  border-left: 3px dashed var(--gold-deep);
}
.doc.is-ready { border-left: 3px solid var(--gold); }

.doc-status {
  margin: 0;
  color: var(--mute);
  font-size: 1rem;
}
.doc.is-ready .doc-status { color: var(--gold-soft); }

.doc-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.doc-actions[hidden] { display: none; }

/* ---------- Project list ---------- */

.project-list { list-style: none; margin: 3rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.project-list li { border-bottom: 1px solid var(--line); }
.project-list a {
  display: block;
  padding: 2rem 1.5rem 2rem 1.5rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  text-decoration: none;
  color: var(--bone);
  transition: background 160ms;
}
.project-list a:hover { background: var(--panel); }
.project-list h2 { transition: color 160ms; }
.project-list a:hover h2 { color: var(--gold-soft); }
.project-list p { margin: 0; color: var(--mute); max-width: 40rem; }

/* ---------- Sketch and photo gallery ---------- */

.gallery-head { margin: 4rem 0 1.5rem; }
.gallery-head p { margin: 0; color: var(--mute); }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 0.6rem; font-size: 0.98rem; color: var(--mute); }
.gallery img { width: 100%; height: auto; border: 1px solid var(--line); }

.slot {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  border: 2px dashed var(--gold-deep);
  color: var(--mute);
  font-size: 1rem;
  background: rgba(33, 18, 43, 0.5);
}
.gallery .wide { grid-column: 1 / -1; }
.gallery .wide .slot { aspect-ratio: 16 / 9; }
@media (max-width: 40rem) { .gallery { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--night-deep);
}
.site-footer .wrap {
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  color: var(--mute);
  font-size: 0.98rem;
}
.site-footer p { margin: 0; }
