/* ---------------------------------------------------------
   Hemlyn — tokens
--------------------------------------------------------- */
:root{
  --ink: #14110d;
  --ink-soft: #211c16;
  --ink-line: rgba(246, 241, 231, 0.14);

  --paper: #f6f1e7;
  --paper-soft: #efe7d6;
  --paper-line: rgba(20, 17, 13, 0.12);

  --bronze: #b6884f;
  --bronze-light: #d9b479;
  --terracotta: #a15c3e;
  --moss: #5c6b53;

  --ink-70: rgba(20, 17, 13, 0.7);
  --ink-50: rgba(20, 17, 13, 0.5);
  --paper-80: rgba(246, 241, 231, 0.82);
  --paper-55: rgba(246, 241, 231, 0.55);

  --serif: "Fraunces", ui-serif, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
  color-scheme: light;
}

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

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a{ color: inherit; }

/* film-grain texture, subtle, over everything */
.grain{
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------
   Shared type helpers
--------------------------------------------------------- */
.eyebrow{
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin: 0 0 1.1rem;
}
.eyebrow--light{ color: var(--paper-55); }

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

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.hero{
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 12%, #221c15 0%, var(--ink) 55%, #0d0b08 100%);
  color: var(--paper);
  overflow: hidden;
  padding: 6rem 1.5rem;
}

.hero-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-inner{
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 46rem;
}

.hero .eyebrow{
  color: var(--bronze-light);
  opacity: 0;
  animation: rise 1s var(--ease) 0.15s forwards;
}

.wordmark{
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.4rem, 12vw, 8.5rem);
  line-height: 0.96;
  letter-spacing: -0.01em;
  color: var(--paper);
  opacity: 0;
  animation: rise 1.1s var(--ease) 0.3s forwards;
}

.tagline{
  margin: 1.4rem auto 0;
  max-width: 26rem;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 400;
  color: var(--paper-80);
  opacity: 0;
  animation: rise 1s var(--ease) 0.5s forwards;
}

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

.scroll-cue{
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px;
  height: 3.2rem;
  background: var(--ink-line);
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.1s forwards;
}
.scroll-cue span{
  position: absolute;
  top: 0;
  left: -1.5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bronze-light);
  animation: cue-travel 2.6s ease-in-out infinite;
}
@keyframes cue-travel{
  0%{ top: 0; opacity: 0; }
  15%{ opacity: 1; }
  85%{ opacity: 1; }
  100%{ top: 100%; opacity: 0; }
}
@keyframes fadeIn{ to{ opacity: 1; } }

/* ---------------------------------------------------------
   Statement
--------------------------------------------------------- */
.statement{
  padding: clamp(5rem, 14vw, 9rem) 1.5rem;
  text-align: center;
  background: var(--paper);
}
.statement-text{
  margin: 0 auto;
  max-width: 42rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 4.4vw, 2.7rem);
  line-height: 1.28;
  color: var(--ink);
}
.statement-text em{
  font-style: italic;
  color: var(--terracotta);
}

/* ---------------------------------------------------------
   Mosaic (flagship) section
--------------------------------------------------------- */
.mosaic-section{
  background: var(--ink);
  color: var(--paper);
  padding: clamp(4.5rem, 10vw, 7rem) 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  max-width: 78rem;
  margin: 0 auto;
}

.mosaic-visual{
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 34rem;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  border-radius: 18px;
  overflow: hidden;
  transform: rotate(-1.2deg);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.55);
}

.mosaic-visual::after{
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(115deg,
    transparent 40%,
    rgba(246,241,231,0.22) 48%,
    rgba(246,241,231,0.34) 50%,
    rgba(246,241,231,0.22) 52%,
    transparent 60%);
  transform: translateX(-60%);
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: shimmer 7s ease-in-out infinite;
}
@keyframes shimmer{
  0%, 20%{ transform: translateX(-60%); }
  80%, 100%{ transform: translateX(60%); }
}

.tile{
  position: relative;
  border-radius: 5px;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease);
  background: var(--ink-soft);
}
.mosaic-visual.is-visible .tile{
  transform: scale(1) rotate(var(--tr, 0deg));
  opacity: var(--to, 1);
}
.tile.tone-a{ background: var(--bronze); }
.tile.tone-b{ background: var(--terracotta); }
.tile.tone-c{ background: var(--moss); }
.tile.tone-d{ background: var(--bronze-light); }
.tile.tone-e{ background: #3a332a; }
.tile.dot::after{
  content: "";
  position: absolute;
  top: 12%;
  right: 12%;
  width: 14%;
  height: 14%;
  min-width: 4px;
  min-height: 4px;
  border-radius: 50%;
  background: var(--paper);
  opacity: 0.85;
}

.mosaic-copy{ max-width: 32rem; }

.mosaic-title{
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  color: var(--paper);
}

.mosaic-tagline{
  margin: 1rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--paper-80);
  font-weight: 400;
  max-width: 26rem;
}

.mosaic-pipeline{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.8rem;
  margin: 2.4rem 0 0;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze-light);
}
.mosaic-pipeline i{
  width: 18px;
  height: 1px;
  background: var(--ink-line);
  display: inline-block;
}

/* ---------------------------------------------------------
   Products
--------------------------------------------------------- */
.products{
  padding: clamp(5rem, 12vw, 8rem) 1.5rem;
  text-align: center;
  background: var(--paper-soft);
  border-top: 1px solid var(--paper-line);
}
.products-title{
  margin: 0 0 2.6rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--ink);
}

.links-row{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 40rem;
  margin: 0 auto;
}

.link-card{
  flex: 1 1 14rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.6rem;
  border: 1px solid var(--paper-line);
  border-radius: 12px;
  background: var(--paper);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), background 0.35s var(--ease);
}
.link-card:hover{
  border-color: var(--bronze);
  transform: translateY(-3px);
  background: var(--paper);
}
.link-card-arrow{
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--bronze);
  transition: transform 0.35s var(--ease);
}
.link-card:hover .link-card-arrow{
  transform: translate(2px, -2px);
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.site-footer{
  background: var(--ink);
  color: var(--paper-55);
  text-align: center;
  padding: 3.4rem 1.5rem 3rem;
}
.footer-mark{
  width: 10px;
  height: 10px;
  margin: 0 auto 1.1rem;
  background: var(--bronze);
  border-radius: 2px;
  transform: rotate(45deg);
}
.footer-entity{
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--paper-80);
}
.footer-meta{
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media (max-width: 860px){
  .mosaic-section{
    grid-template-columns: 1fr;
    text-align: center;
  }
  .mosaic-copy{ margin: 0 auto; }
  .mosaic-pipeline{ justify-content: center; }
}

@media (max-width: 480px){
  .hero{ padding: 5rem 1.25rem; }
  .links-row{ flex-direction: column; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .reveal, .wordmark, .tagline, .hero .eyebrow, .scroll-cue, .tile{
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
