/* 
   TEWODROS II — Tribute Page
   Ethiopian heritage editorial design system
    */

:root {
  --charcoal: #171614;
  --parchment: #e9dfc9;
  --stone: #b8b0a0;
  --ochre: #9a6841;
  --eth-red: #7e342d;
  --ivory: #f5f1e8;

  --text: var(--charcoal);
  --text-muted: #4f4a43;
  --border: rgba(23, 22, 20, 0.14);

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --wrap: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/*  Utilities  */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0;
}

.accent { color: var(--ochre); }
.red { color: var(--eth-red); }
.stone { color: var(--stone); }
.narrow { max-width: 44rem; }

.h-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.02;
  margin: 1.5rem 0 0;
}

.prose p {
  font-size: 0.975rem;
  line-height: 1.85;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}
.prose p:last-child { margin-bottom: 0; }
.prose--inverse p { color: var(--stone); }

.sec {
  padding: 6rem 0;
}
.bg-parchment { background: var(--parchment); }
.bg-stone { background: color-mix(in srgb, var(--stone) 45%, var(--ivory)); }
.bg-charcoal { background: var(--charcoal); color: var(--ivory); }

/* Subtle film grain overlay */
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

.two-col {
  display: grid;
  gap: 3rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 3rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.link-arrow:hover { color: var(--ochre); border-color: var(--ochre); }
.link-arrow--inverse { color: var(--stone); border-color: rgba(184, 176, 160, 0.4); }

.bounce { animation: bounce 1.8s infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/*  Scroll reveal  */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/*  01 Navigation  */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(245, 241, 232, 0.9);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.nav__inner {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand { white-space: nowrap; }
.nav__links { display: flex; gap: 1.25rem; }
@media (max-width: 420px) {
  .nav__brand { font-size: 0.625rem; }
  .nav__links { gap: 0.9rem; }
  .nav__links a { font-size: 0.625rem; letter-spacing: 0.18em; }
}
.nav__links a { color: var(--text-muted); transition: color 0.3s var(--ease); }
.nav__links a:hover,
.nav__links a.is-active { color: var(--ochre); }
.nav__links a.is-active { position: relative; }
.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.55rem;
  height: 1px;
  background: currentColor;
}

/*  02 Hero  */
.hero { padding: 8rem 0 4rem; overflow: hidden; }
.hero__grid { display: grid; gap: 3rem; align-items: end; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 13vw, 9rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  margin: 1.5rem 0 0;
}
.hero__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.15;
  color: var(--text-muted);
  max-width: 28rem;
  margin: 2rem 0 0;
}
.hero__period { margin-top: 2rem; }
.hero__figure { margin: 0; }
.hero__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  box-shadow: 0 40px 80px -40px rgba(23, 22, 20, 0.55);
  clip-path: inset(0 0 0 0);
  animation: unmask 1.6s var(--ease) both;
}
@keyframes unmask {
  from { clip-path: inset(12% 0 0 0); opacity: 0; transform: scale(1.04); }
  to { clip-path: inset(0 0 0 0); opacity: 1; transform: none; }
}
.hero__figure figcaption,
.letter figcaption {
  margin-top: 1rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/*  04 Rise  */
.rise { display: grid; gap: 3rem; margin-top: 4rem; }
.big-year {
  font-family: var(--font-display);
  font-size: clamp(5rem, 16vw, 11rem);
  line-height: 0.8;
  color: var(--ochre);
  margin: 0;
}
.rise__caption {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--stone);
  margin: 1rem 0 0;
}

/*  05 Statement  */
.statement { padding: 7rem 0; overflow: hidden; }
.statement__grid {
  display: grid;
  gap: 4rem;
  align-items: center;
}
.statement__copy { position: relative; z-index: 2; }
.statement__type {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.5rem, 15vw, 11rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
  margin: 1.5rem 0 0;
}
.statement__body {
  max-width: 34rem;
  margin: 3rem 0 0 auto;
  font-size: 0.975rem;
  line-height: 1.85;
  color: var(--text-muted);
}
.statement__note {
  max-width: 29rem;
  margin: 1.5rem 0 0 auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.statement__visuals {
  min-height: 31rem;
  position: relative;
}
.statement__image {
  position: absolute;
  margin: 0;
  background: var(--ivory);
  border: 1px solid rgba(23, 22, 20, 0.14);
  box-shadow: 0 28px 60px -36px rgba(23, 22, 20, 0.55);
}
.statement__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.statement__image figcaption {
  padding: 0.8rem 0.9rem 0.9rem;
  font-size: 0.625rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--ivory);
}
.statement__image--map {
  width: min(76%, 25rem);
  height: 22rem;
  top: 0;
  right: 0;
  transform: rotate(1.2deg);
}
.statement__image--map img { object-position: center; }
.statement__image--mortar {
  width: min(72%, 24rem);
  height: 18rem;
  left: 0;
  bottom: 0;
  transform: rotate(-2deg);
  z-index: 2;
}
.statement__image--mortar img { object-position: center; }

/*  06 Cards  */
.cards { display: grid; gap: 1.5rem; margin-top: 3.5rem; }
.card {
  border-top: 1px solid rgba(23, 22, 20, 0.2);
  padding-top: 1.5rem;
  transition: border-color 0.4s var(--ease), opacity 1s var(--ease), transform 1s var(--ease);
}
.card:hover { border-top-color: var(--ochre); }
.card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.875rem;
  margin: 1rem 0 0;
}
.card p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin: 1rem 0 0;
}

/*  07 Letter  */
.letter {
  margin: 0;
  border: 1px solid rgba(23, 22, 20, 0.15);
  background: var(--parchment);
  padding: 2rem;
}
.letter__year {
  font-family: var(--font-display);
  font-size: 3.75rem;
  line-height: 1;
  color: var(--ochre);
  margin: 0 0 1.5rem;
}
.letter hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.letter blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
}

/*  08 Timeline  */
.timeline {
  list-style: none;
  margin: 4rem auto 0;
  padding: 0;
  max-width: 46rem;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 7px;
  width: 1px;
  background: rgba(23, 22, 20, 0.2);
}
.timeline li { position: relative; padding: 0 0 3.5rem 2.5rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(23, 22, 20, 0.4);
  background: var(--ivory);
  transition: background 0.5s var(--ease);
}
.timeline li::after {
  content: "";
  position: absolute;
  top: calc(0.5rem + 4px);
  left: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stone);
  transition: background 0.5s var(--ease), transform 0.5s var(--ease);
}
.timeline li.is-visible::after { background: var(--ochre); transform: scale(1.1); }
.timeline h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0.5rem 0 0;
}
.timeline p.t-text {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

/*  09 Maqdala  */
.maqdala { background: var(--charcoal); color: var(--ivory); }
.maqdala__figure { position: relative; margin: 0; overflow: hidden; }
.maqdala__figure img {
  width: 100%;
  height: 60vh;
  object-fit: cover;
  opacity: 0.7;
  will-change: transform;
}
.maqdala__figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--charcoal), rgba(23, 22, 20, 0.4) 55%, rgba(23, 22, 20, 0.3));
}
.maqdala__figure figcaption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding-bottom: 3rem;
  max-width: var(--wrap);
  margin-inline: auto;
}
.image-credit {
  margin: 0.8rem 0 0;
  font-size: 0.625rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: rgba(245, 241, 232, 0.72);
}
.maqdala__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.85;
  margin: 1rem 0;
}
.maqdala__body { padding-block: 6rem; }

/*  10 Quote  */
.quote { text-align: center; }
.quote__mark {
  font-family: var(--font-display);
  font-size: 8rem;
  line-height: 0.5;
  color: var(--ochre);
  margin: 0;
}
.quote__text {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1.25;
  margin: 2.5rem auto 0;
  max-width: 46rem;
}
.quote__attr { margin-top: 2.5rem; color: var(--text-muted); }

/*  11 Legacy  */
.legacy { display: grid; gap: 2.5rem; margin-top: 4rem; }
.legacy__col { padding-top: 2rem; border-top: 2px solid var(--ochre); }
.legacy__col--red { border-top-color: var(--eth-red); }
.legacy__col h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.875rem;
  margin: 0;
}
.legacy__col ul { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.legacy__col li {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-muted);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(23, 22, 20, 0.1);
}

/*  12 What remains  */
.geez {
  font-family: var(--font-display);
  font-size: 1.875rem;
  color: var(--ochre);
  margin: 1.5rem 0 0;
}

/*  13 Footer  */
.footer {
  background: var(--charcoal);
  color: var(--ivory);
  padding: 6rem 0;
  text-align: center;
}
.footer__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 0.85;
  margin: 2rem 0 1.5rem;
}
.footer__line {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--stone);
  max-width: 28rem;
  margin: 2.5rem auto 0;
}
.footer__note {
  margin-top: 4rem;
  font-size: 0.75rem;
  line-height: 1.7;
  color: rgba(184, 176, 160, 0.7);
}

/*  Back to top button  */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--ivory);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
}
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--ochre); border-color: var(--ochre); }


/*  Accessibility and interaction polish  */
:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 4px;
}

::selection {
  background: var(--ochre);
  color: var(--ivory);
}

[id] { scroll-margin-top: 5rem; }

/* 
   Responsive — mobile designed intentionally, then scaled up
    */
@media (max-width: 767px) {
  .statement__visuals { min-height: 25rem; margin-top: 1rem; }
  .statement__image--map { width: 78%; height: 16rem; }
  .statement__image--mortar { width: 74%; height: 13rem; }
}

@media (min-width: 768px) {
  .sec { padding: 7rem 0; }
  .wrap { padding-inline: 2rem; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .legacy { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
  .letter { padding: 3rem; }
  .letter blockquote { font-size: 1.75rem; }

  /* Alternating desktop timeline */
  .timeline::before { left: 50%; }
  .timeline li { padding-left: 0; }
  .timeline li::before { left: 50%; transform: translateX(-50%); }
  .timeline li::after { left: 50%; transform: translateX(-50%); }
  .timeline li.is-visible::after { transform: translateX(-50%) scale(1.1); }
  .timeline .t-inner { width: 50%; padding-right: 3rem; text-align: right; }
  .timeline li:nth-child(even) .t-inner {
    margin-left: auto;
    padding-right: 0;
    padding-left: 3rem;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .sec { padding: 9rem 0; }
  .statement { padding: 10rem 0; }
  .statement__grid { grid-template-columns: 1.05fr 0.95fr; gap: 5rem; }
  .statement__visuals { min-height: 38rem; }
  .statement__image--map { width: 25rem; height: 23rem; }
  .statement__image--mortar { width: 23rem; height: 19rem; }
  .hero { padding: 11rem 0 6rem; }
  .hero__grid { grid-template-columns: 1.05fr 0.95fr; gap: 4rem; }
  .two-col { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
  .rise { grid-template-columns: 0.8fr 1.2fr; }
  .maqdala__figure img { height: 68vh; }
  .nav__inner { padding-inline: 3rem; }
  .wrap { padding-inline: 3rem; }
}

/*  Accessibility: reduced motion  */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .hero__figure img {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  .bounce { animation: none; }
}
