/*
  Hero 02 — Verso, standalone HTML/CSS implementation.
  No build step, no framework, no external dependency: copy this file and
  index.html into any project and open it as-is.
*/

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

:root {
  --ink: #1c1a17;
  --ink-soft: #33302a;
  --clay: #b5552e;
  --clay-dark: #9c4726;
  --clay-muted: #8a5a3c;
  --cream: #faf5ef;
  --line: #e7ddcf;
  --stone-text: #57503f;
  --parchment: #b5a98f;
  --white: #ffffff;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

body {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--ink);
  background-color: var(--cream);
  line-height: 1.5;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--cream);
}

/* Motion — disabled entirely under reduced motion; every element already
   renders at its final, fully visible state outside this media query. Block
   stacking for the headline's three lines is a layout decision, not an
   animation, so it stays outside this media query. */
.heading span {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes al-fade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  @keyframes al-up {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes al-mask {
    from {
      clip-path: inset(0 0 100% 0);
      opacity: 0;
    }
    to {
      clip-path: inset(0 0 0% 0);
      opacity: 1;
    }
  }
  @keyframes al-photo {
    from {
      opacity: 0;
      transform: scale(1.06);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  @keyframes al-layer {
    from {
      opacity: 0;
      transform: translateY(14px) scale(0.96);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  @keyframes al-spin {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }
  @keyframes al-menu {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav__menu {
    animation: al-menu 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .nav {
    animation: al-fade 550ms ease-out both;
  }
  .eyebrow,
  .description,
  .actions,
  .footnote {
    animation: al-up 750ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .eyebrow {
    animation-delay: 60ms;
  }
  .description {
    animation-delay: 420ms;
  }
  .actions {
    animation-delay: 500ms;
  }
  .footnote {
    animation-delay: 580ms;
  }
  .heading span {
    animation: al-mask 850ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .heading span:nth-child(1) {
    animation-delay: 120ms;
  }
  .heading span:nth-child(2) {
    animation-delay: 220ms;
  }
  .heading span:nth-child(3) {
    animation-delay: 320ms;
  }
  .photo-main {
    animation: al-photo 1000ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .shape-circle {
    animation: al-layer 700ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
  }
  .photo-secondary {
    animation: al-layer 700ms cubic-bezier(0.16, 1, 0.3, 1) 260ms both;
  }
  .quote-card {
    animation: al-layer 700ms cubic-bezier(0.16, 1, 0.3, 1) 420ms both;
  }
  .ring--large {
    animation: al-layer 700ms cubic-bezier(0.16, 1, 0.3, 1) 500ms both;
  }
  .ring__spin {
    animation: al-spin 40s linear infinite;
  }
}

/* Navigation */
.nav {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.nav__brand {
  flex-shrink: 0;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-style: italic;
  color: var(--ink);
}

.nav__links {
  display: none;
  align-items: center;
  gap: 2rem;
  font-family: var(--font-sans);
}

.nav__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-text);
  transition: color 150ms ease;
}

.nav__links a:hover {
  color: var(--ink);
}

.chevron {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  opacity: 0.6;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
}

@media (min-width: 640px) {
  .nav__actions {
    gap: 1.25rem;
  }
}

.nav__search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-text);
  transition: color 150ms ease;
}

.nav__search svg {
  width: 1rem;
  height: 1rem;
}

.nav__search:hover {
  color: var(--ink);
}

.nav__search-label {
  display: none;
}

.nav__divider {
  display: none;
  width: 1px;
  height: 1.25rem;
  background-color: var(--line);
}

.nav__links a:focus-visible,
.nav__search:focus-visible,
.footnote__link:focus-visible,
.nav__menu-btn:focus-visible,
.nav__menu a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
  border-radius: 4px;
}

/* "Join Library" moves into the mobile/tablet menu below `lg` (1024px) —
   it only stays in the header once there's room for the full nav beside
   it. Scoped as `.button.nav__join` (specificity 0,0,2,0) rather than bare
   `.nav__join` (0,0,1,0): the base `.button { display: inline-flex; }` rule
   below shares this element and has equal specificity, so a bare
   `.nav__join { display: none; }` only wins by accident of source order —
   this makes it win unconditionally. */
.button.nav__join {
  display: none;
}

/* Mobile/tablet menu — the `nav__links` (and, below `lg`, `nav__join`)
   replacement, so collapsing to icon-only navigation never leaves those
   items with no way to reach them. */
.nav__menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 999px;
  color: var(--stone-text);
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.nav__menu-btn:hover {
  background-color: #f1e9db;
  color: var(--ink);
}

.nav__menu-btn svg {
  width: 18px;
  height: 18px;
}

.nav__menu-btn .icon-close {
  display: none;
}

.nav__menu-btn.is-open .icon-menu {
  display: none;
}

.nav__menu-btn.is-open .icon-close {
  display: block;
}

.nav__menu {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 20;
  background-color: var(--cream);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 20px 40px -20px rgba(28, 26, 23, 0.15);
}

.nav__menu[hidden] {
  display: none;
}

.nav__menu-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
}

.nav__menu-inner a {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone-text);
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.nav__menu-inner a:hover {
  background-color: #f1e9db;
  color: var(--ink);
}

/* Scoped as `.nav__menu-inner a.nav__menu-cta` (specificity 0,0,2,1) rather
   than bare `.nav__menu-cta` (0,0,1,0): the sibling rule
   `.nav__menu-inner a` above already sets `color`, and at equal specificity
   that would have won by source order alone — this makes the CTA's own
   background/text color win unconditionally, with no `!important` needed. */
.nav__menu-inner a.nav__menu-cta {
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background-color: var(--ink);
  color: var(--white);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
}

.nav__menu-inner a.nav__menu-cta:hover {
  background-color: var(--ink-soft);
  color: var(--white);
}

@media (min-width: 640px) {
  .nav__search-label {
    display: inline;
  }
  .nav__divider {
    display: block;
  }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  transition: background-color 150ms ease;
}

.button--dark {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  background-color: var(--ink);
}

@media (min-width: 640px) {
  .button--dark {
    padding: 0.5rem 1.25rem;
  }
}

.button--dark:hover {
  background-color: var(--ink-soft);
}

.button--primary {
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  color: var(--white);
  background-color: var(--clay);
}

.button--primary:hover {
  background-color: var(--clay-dark);
}

.button--primary:hover .arrow {
  transform: translateX(4px);
}

.button--text {
  padding: 0;
  font-size: 0.875rem;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(28, 26, 23, 0.3);
  text-underline-offset: 4px;
}

.button--text:hover {
  text-decoration-color: var(--ink);
}

.arrow {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.arrow--diagonal {
  transform: translateY(-2px) rotate(-45deg);
  transition:
    transform 200ms ease,
    color 150ms ease;
}

.footnote__link:hover .arrow--diagonal {
  transform: translate(2px, -6px) rotate(-45deg);
}

/* Introduction */
.intro {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 2.7rem + 2.8vw, 4rem) clamp(1rem, 0.3rem + 3vw, 2rem) clamp(4rem, 3rem + 3vw, 6rem);
}

.intro__grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 3.5rem;
}

.intro__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
}

.eyebrow__rule {
  width: 1.5rem;
  height: 1px;
  background-color: var(--clay);
}

.heading {
  margin: 1.5rem 0 0;
  font-weight: 400;
  font-size: clamp(3rem, 2.1rem + 3.6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.heading__accent {
  color: var(--clay);
  font-style: italic;
}

.description {
  margin: 1.75rem 0 0;
  max-width: 28rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--stone-text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: 2.25rem;
}

.footnote {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.footnote__divider {
  width: 1px;
  height: 2.25rem;
  background-color: var(--line);
}

.footnote__link {
  display: inline-flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--stone-text);
  transition: color 150ms ease;
}

.footnote__link:hover {
  color: var(--ink);
}

.footnote__link span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* Rotating circular labels */
.ring {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.ring svg text {
  fill: currentColor;
  text-transform: uppercase;
}

.ring--small {
  width: 76px;
  height: 76px;
  color: var(--clay-muted);
}

.ring--large {
  display: none;
  position: absolute;
  top: -1.5rem;
  right: -1.5rem;
  width: 128px;
  height: 128px;
  color: var(--ink);
  background-color: var(--cream);
  border: 1px solid rgba(28, 26, 23, 0.1);
  box-shadow: 0 12px 30px -16px rgba(28, 26, 23, 0.4);
}

.ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Composition */
.composition {
  position: relative;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.composition__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: 0.75rem;
  aspect-ratio: 4 / 5;
}

.shape-circle {
  display: none;
  grid-column: 1 / 9;
  grid-row: 1 / 8;
  border-radius: 50%;
  background-image: linear-gradient(to bottom right, #d97b4a, var(--clay));
}

.photo-main {
  grid-column: 1 / 13;
  grid-row: 1 / 13;
  overflow: hidden;
  background-color: var(--line);
  box-shadow: 0 30px 60px -30px rgba(28, 26, 23, 0.35);
  border-radius: 999px 999px 1.25rem 1.25rem;
}

.photo-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-secondary {
  display: none;
  grid-column: 1 / 6;
  grid-row: 8 / 13;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 20px 40px -24px rgba(28, 26, 23, 0.4);
}

.photo-secondary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quote-card {
  position: relative;
  margin: -2.5rem 1.5rem 0;
  border-radius: 1rem;
  background-color: var(--ink);
  padding: 1.25rem;
  box-shadow: 0 20px 40px -20px rgba(28, 26, 23, 0.5);
}

.quote-card__mark {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  line-height: 1;
  color: var(--clay);
}

.quote-card__text {
  margin: 0.25rem 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: #f3ede3;
  font-style: italic;
}

.quote-card__attribution {
  margin: 0.75rem 0 0;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--parchment);
}

/* Structural breakpoints — reserved for layout changes that genuinely need
   to happen, not ordinary proportional scaling (handled above via clamp). */
@media (min-width: 640px) {
  .quote-card {
    padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  .composition {
    max-width: none;
  }

  .composition__grid {
    aspect-ratio: 9 / 10;
  }

  .shape-circle {
    display: block;
  }

  .photo-main {
    grid-column: 5 / 13;
    grid-row: 1 / 11;
  }

  .photo-secondary {
    display: block;
  }

  .quote-card {
    position: absolute;
    top: 58%;
    left: -1.75rem;
    margin: 0;
    width: 14rem;
  }
}

@media (min-width: 1024px) {
  .nav__links {
    display: flex;
  }

  .button.nav__join {
    display: inline-flex;
  }

  /* Full nav links (and the header's own "Join Library") are visible from
     here up, so the mobile/tablet menu trigger and its panel have nothing
     left to replace. */
  .nav__menu-btn {
    display: none;
  }

  .nav__menu {
    display: none !important;
  }

  .intro__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 3rem;
  }

  .composition {
    margin: 0;
  }

  .quote-card {
    width: 15rem;
  }

  .ring--large {
    display: flex;
  }
}
