@layer reset, base, layout, components, utilities;

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

  html {
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  p {
    margin: 0;
  }

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

@layer base {
  :root {
    color-scheme: dark;
    --ink: #f0eadc;
    --ink-muted: #bbb9aa;
    --ink-faint: #85877c;
    --night: #101510;
    --night-deep: #0a0e0b;
    --night-raised: #161d17;
    --moss: #95a674;
    --moss-bright: #bdca98;
    --gold: #c6a866;
    --line: rgb(230 224 207 / 14%);
    --line-strong: rgb(230 224 207 / 25%);
    --serif: Georgia, "Times New Roman", serif;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  html {
    background: var(--night-deep);
    scroll-padding-top: 6rem;
  }

  body {
    min-width: 20rem;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 82% 8%, rgb(120 141 86 / 10%), transparent 28rem),
      var(--night);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
  }

  a {
    color: inherit;
  }

  a:focus-visible {
    border-radius: 0.125rem;
    outline: 3px solid var(--moss-bright);
    outline-offset: 0.3rem;
  }

  ::selection {
    background: var(--moss-bright);
    color: var(--night-deep);
  }
}

@layer layout {
  .shell {
    width: min(100% - 2.5rem, 78rem);
    margin-inline: auto;
  }

  .section {
    padding-block: clamp(5rem, 10vw, 9rem);
  }

  .site-header {
    position: absolute;
    z-index: 20;
    top: 0;
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .site-header__inner,
  .site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .site-header__inner {
    min-height: 5rem;
  }

  .hero {
    position: relative;
    isolation: isolate;
    min-height: min(58rem, 100svh);
    overflow: hidden;
    padding-block: clamp(8.5rem, 15vw, 12rem) clamp(5rem, 9vw, 8rem);
    border-bottom: 1px solid var(--line);
  }

  .hero::before {
    position: absolute;
    z-index: -2;
    inset: 0;
    background-image:
      linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px),
      linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px);
    background-size: 4rem 4rem;
    content: "";
    mask-image: linear-gradient(to bottom, black, transparent 85%);
  }

  .hero::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, var(--night) 0%, transparent 65%);
    content: "";
    pointer-events: none;
  }

  .hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(24rem, 0.98fr);
    align-items: center;
    gap: clamp(3rem, 6vw, 7rem);
  }

  .hero__copy {
    position: relative;
    z-index: 2;
  }

  .section-heading {
    display: grid;
    grid-template-columns: minmax(18rem, 0.9fr) minmax(20rem, 1.1fr);
    gap: clamp(3rem, 8vw, 9rem);
    align-items: end;
  }
}

@layer components {
  .skip-link {
    position: fixed;
    z-index: 100;
    top: 1rem;
    left: 1rem;
    padding: 0.65rem 1rem;
    transform: translateY(-200%);
    background: var(--ink);
    color: var(--night);
    font-weight: 700;
    text-decoration: none;
  }

  .skip-link:focus {
    transform: translateY(0);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    gap: 0.75rem;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1;
    text-decoration: none;
  }

  .brand img {
    width: 2.25rem;
    height: auto;
  }

  nav {
    display: flex;
    align-items: center;
    gap: clamp(1.2rem, 3vw, 2.5rem);
  }

  nav a {
    color: var(--ink-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
  }

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

  nav .nav-status {
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--line-strong);
    color: var(--moss-bright);
  }

  .eyebrow,
  .section-label {
    color: var(--moss-bright);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .eyebrow span {
    width: 2.5rem;
    height: 1px;
    background: var(--gold);
  }

  h1,
  h2,
  h3 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.02;
  }

  h1 {
    max-width: 13ch;
    font-size: clamp(3.6rem, 7.6vw, 7.1rem);
  }

  .hero__lede {
    max-width: 38rem;
    margin-top: 2rem;
    padding-left: 1.25rem;
    border-left: 1px solid var(--gold);
    color: var(--ink-muted);
    font-family: var(--serif);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.55;
  }

  .hero__actions {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 2.75rem;
  }

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-height: 3.25rem;
    padding: 0.75rem 1.25rem;
    background: var(--moss-bright);
    color: var(--night-deep);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 180ms ease, transform 180ms ease;
  }

  .button:hover {
    background: var(--ink);
    transform: translateY(-2px);
  }

  .hero__actions p {
    color: var(--ink-faint);
    font-size: 0.73rem;
    letter-spacing: 0.08em;
    line-height: 1.45;
    text-transform: uppercase;
  }

  .hero__actions strong,
  .hero__actions span {
    display: block;
  }

  .hero__actions strong {
    color: var(--gold);
    font-size: 0.8rem;
  }

  .realm {
    position: relative;
    min-width: 0;
    border: 1px solid var(--line-strong);
    background:
      radial-gradient(circle at 50% 48%, rgb(154 169 116 / 12%), transparent 46%),
      linear-gradient(145deg, rgb(255 255 255 / 3%), rgb(255 255 255 / 0%));
    box-shadow: 0 2rem 6rem rgb(0 0 0 / 30%);
    transform: rotate(1.5deg);
  }

  .realm::before,
  .realm::after {
    position: absolute;
    width: 3rem;
    height: 3rem;
    border-color: var(--gold);
    content: "";
    opacity: 0.65;
  }

  .realm::before {
    top: -0.45rem;
    left: -0.45rem;
    border-top: 1px solid;
    border-left: 1px solid;
  }

  .realm::after {
    right: -0.45rem;
    bottom: -0.45rem;
    border-right: 1px solid;
    border-bottom: 1px solid;
  }

  .realm__caption {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .realm__media {
    --realm-media-position: 68% 50%;
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--night-deep);
  }

  .realm__media::after {
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to top, rgb(8 12 9 / 34%), transparent 28%),
      linear-gradient(90deg, rgb(8 12 9 / 15%), transparent 55%);
    content: "";
    pointer-events: none;
  }

  .realm__media > :is(img, video) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--realm-media-position);
  }

  .realm__note {
    position: absolute;
    right: 1.5rem;
    bottom: 1.25rem;
    padding: 0.3rem 0.6rem;
    background: rgb(10 14 11 / 75%);
    color: var(--ink-muted);
    font-family: var(--serif);
    font-size: 0.85rem;
    font-style: italic;
  }

  .world {
    background: var(--night-deep);
  }

  .section-label {
    margin-bottom: 2rem;
  }

  .section-heading h2,
  .pillars__intro h2,
  .status h2 {
    font-size: clamp(3rem, 6vw, 5.75rem);
  }

  .section-heading > p {
    max-width: 42rem;
    color: var(--ink-muted);
    font-family: var(--serif);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
  }

  .world__details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: clamp(4rem, 8vw, 7rem);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .world__details article {
    min-height: 19rem;
    padding: 1.75rem clamp(1.25rem, 2vw, 2rem) 2rem;
    border-left: 1px solid var(--line);
  }

  .world__details article:last-child {
    border-right: 1px solid var(--line);
  }

  .world__details article > span {
    color: var(--gold);
    font-family: var(--serif);
    font-size: 0.78rem;
  }

  .world__details h3 {
    margin-top: 4.5rem;
    font-size: 1.65rem;
  }

  .world__details p {
    margin-top: 1rem;
    color: var(--ink-faint);
    font-size: 0.92rem;
  }

  .pillars {
    position: relative;
    overflow: hidden;
    background:
      linear-gradient(105deg, rgb(104 119 76 / 7%), transparent 40%),
      var(--night-raised);
  }

  .pillars::after {
    position: absolute;
    top: 12%;
    right: -8rem;
    width: 24rem;
    height: 24rem;
    border: 1px solid rgb(190 202 154 / 8%);
    content: "";
    transform: rotate(45deg);
  }

  .pillars__intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 3rem;
  }

  .pillars__intro h2 {
    max-width: 12ch;
  }

  .pillars__intro h2 i {
    color: var(--gold);
    font-weight: 400;
  }

  .pillars__intro > p {
    max-width: 31rem;
    color: var(--ink-muted);
  }

  .pillar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: clamp(3.5rem, 7vw, 6rem);
  }

  .pillar-card {
    display: flex;
    min-height: 23rem;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    border: 1px solid var(--line);
    background: rgb(9 13 10 / 24%);
    transition: border-color 180ms ease, transform 180ms ease;
  }

  .pillar-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-0.25rem);
  }

  .pillar-card__number {
    color: var(--gold);
    font-family: var(--serif);
    font-size: 0.85rem;
  }

  .pillar-card h3 {
    font-size: 2.6rem;
  }

  .pillar-card p {
    margin-top: 1rem;
    color: var(--ink-muted);
    font-size: 0.92rem;
  }

  .status {
    background: var(--ink);
    color: var(--night-deep);
  }

  .status .section-label {
    color: #52613c;
  }

  .status__panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.55fr);
    gap: clamp(3rem, 9vw, 10rem);
    align-items: end;
  }

  .status h2 {
    max-width: 13ch;
  }

  .status__copy {
    padding-top: 1.25rem;
    border-top: 1px solid rgb(15 21 16 / 30%);
  }

  .status__headline {
    margin-bottom: 1rem;
    color: #485337;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .status__copy p:last-child {
    color: #42463e;
  }

  .site-footer {
    padding-block: 2rem;
    background: var(--night-deep);
  }

  .brand--footer {
    font-size: 1rem;
  }

  .brand--footer img {
    width: 1.875rem;
  }

  .site-footer p {
    color: var(--ink-faint);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .site-footer .privacy-note {
    color: var(--ink-muted);
  }

  .not-found {
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: 2rem;
    background:
      radial-gradient(circle at 50% 40%, rgb(149 166 116 / 12%), transparent 24rem),
      linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px),
      linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px),
      var(--night);
    background-size: auto, 4rem 4rem, 4rem 4rem, auto;
  }

  .not-found__panel {
    max-width: 43rem;
    text-align: center;
  }

  .not-found__panel > img {
    width: 3.25rem;
    margin: 0 auto 2rem;
  }

  .not-found__panel .eyebrow {
    justify-content: center;
  }

  .not-found__panel h1 {
    max-width: none;
    font-size: clamp(3rem, 8vw, 6rem);
  }

  .not-found__panel > p:not(.eyebrow) {
    margin-top: 1.5rem;
    color: var(--ink-muted);
  }

  .not-found__panel .button {
    margin-top: 2.5rem;
  }
}

@layer utilities {
  @media (max-width: 62rem) {
    .hero {
      min-height: auto;
    }

    .hero__grid {
      grid-template-columns: 1fr;
    }

    .hero__copy {
      max-width: 50rem;
    }

    .realm {
      width: min(100%, 40rem);
      margin-inline: auto;
    }

    .realm__media {
      --realm-media-position: 50% 50%;
      aspect-ratio: 16 / 9;
    }

    .world__details {
      grid-template-columns: repeat(2, 1fr);
    }

    .world__details article:nth-child(3),
    .world__details article:nth-child(4) {
      border-top: 1px solid var(--line);
    }

    .pillar-grid {
      grid-template-columns: 1fr;
    }

    .pillar-card {
      min-height: 18rem;
    }
  }

  @media (max-width: 44rem) {
    html {
      scroll-padding-top: 5rem;
    }

    .shell {
      width: min(100% - 1.5rem, 78rem);
    }

    .site-header__inner {
      min-height: 4.5rem;
    }

    .site-header nav a:not(.nav-status) {
      display: none;
    }

    .brand {
      font-size: 1.05rem;
    }

    .hero {
      padding-top: 8.5rem;
    }

    h1 {
      font-size: clamp(3.15rem, 15vw, 4.75rem);
    }

    .hero__actions,
    .pillars__intro,
    .site-footer__inner {
      align-items: flex-start;
      flex-direction: column;
    }

    .section-heading,
    .status__panel {
      grid-template-columns: 1fr;
      gap: 2rem;
    }

    .realm__caption span:last-child,
    .realm__note {
      display: none;
    }

    .world__details {
      grid-template-columns: 1fr;
    }

    .world__details article,
    .world__details article:last-child {
      min-height: 15rem;
      border-top: 1px solid var(--line);
      border-right: 1px solid var(--line);
    }

    .world__details article:first-child {
      border-top: 0;
    }

    .world__details h3 {
      margin-top: 3rem;
    }

    .pillar-card {
      min-height: 20rem;
    }

    .site-footer__inner {
      gap: 1rem;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
  }

  @media (forced-colors: active) {
    .hero::before,
    .hero::after,
    .pillars::after {
      display: none;
    }

    .button {
      border: 1px solid ButtonText;
    }
  }
}
