/* ============================================================
   Alamancy — Design Tokens & Styles
   ============================================================ */

:root {
  /* Palette — warm paper & ink */
  --paper:    #F6F2E9;
  --ink:      #1C1A17;
  --ink-soft: #5A554C;
  --accent:   #8A3A2E;
  --rule:     #DAD3C4;

  /* Typography */
  --font-serif: 'Fraunces', 'Georgia', serif;
  --font-mono:  'IBM Plex Mono', 'Menlo', monospace;

  /* Spacing */
  --measure: 680px;
  --space-section: 7rem;
  --space-block: 2.5rem;
}


/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ============================================================
   Layout
   ============================================================ */

main {
  max-width: var(--measure);
  width: 100%;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
  flex: 1;
}


/* ============================================================
   Movement 1 — Mark
   ============================================================ */

.mark {
  margin-bottom: var(--space-section);
  text-align: left;
}

.mark h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 4rem);
  font-weight: 400;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 72;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1rem;
}

.mark .essence {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 520px;
  font-variation-settings: 'opsz' 12;
}


/* ============================================================
   Movement 2 — Premise
   ============================================================ */

.premise {
  margin-bottom: var(--space-section);
  padding-top: var(--space-section);
  border-top: 1px solid var(--rule);
}

.premise p {
  max-width: 600px;
  color: var(--ink);
  font-weight: 300;
  font-variation-settings: 'opsz' 12;
}

.premise p + p {
  margin-top: 1.5rem;
}


/* ============================================================
   Movement 3 — Practice
   ============================================================ */

.practice {
  margin-bottom: var(--space-section);
  padding-top: var(--space-section);
  border-top: 1px solid var(--rule);
}

.practice-item {
  margin-bottom: var(--space-block);
  position: relative;
}

.practice-item:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.practice-item p {
  color: var(--ink);
  font-weight: 300;
  font-variation-settings: 'opsz' 12;
  max-width: 560px;
}


/* ============================================================
   Movement 4 — Contact
   ============================================================ */

.contact {
  padding-top: var(--space-section);
  border-top: 1px solid var(--rule);
  margin-bottom: var(--space-section);
}

.contact .label {
  margin-bottom: 0.75rem;
}

.contact a {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s ease, color 0.4s ease;
  padding-bottom: 2px;
}

.contact a:hover {
  background-size: 100% 1px;
  color: var(--accent);
}


/* ============================================================
   Footer
   ============================================================ */

footer {
  max-width: var(--measure);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
}


/* ============================================================
   Focus States
   ============================================================ */

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}


/* ============================================================
   Staggered Page-Load Reveal
   ============================================================ */

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  animation: fadeRise 550ms ease-out forwards;
}

.reveal-1 { animation-delay: 0ms; }
.reveal-2 { animation-delay: 120ms; }
.reveal-3 { animation-delay: 240ms; }
.reveal-4 { animation-delay: 360ms; }
.reveal-5 { animation-delay: 480ms; }
.reveal-6 { animation-delay: 600ms; }
.reveal-7 { animation-delay: 720ms; }
.reveal-8 { animation-delay: 840ms; }
.reveal-9 { animation-delay: 960ms; }
.reveal-10 { animation-delay: 1080ms; }


/* ============================================================
   Constellation Canvas
   ============================================================ */

#constellation {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}


/* ============================================================
   Hanging Labels (wide screens)
   ============================================================ */

@media (min-width: 920px) {
  .practice-item,
  .contact {
    position: relative;
    padding-left: 0;
  }

  .practice-item > .label,
  .contact > .label {
    position: absolute;
    left: -160px;
    top: 0.25rem;
    width: 140px;
    text-align: right;
  }
}


/* ============================================================
   Reduced Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    animation: none;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}


/* ============================================================
   Responsive — Small Screens
   ============================================================ */

@media (max-width: 640px) {
  main {
    padding: 5rem 1.25rem 3rem;
  }

  :root {
    --space-section: 4.5rem;
  }

  .mark h1 {
    font-size: 2.4rem;
  }

  footer {
    padding: 1.5rem 1.25rem 2rem;
  }
}
