/* ============================================================
   AfuruKei Farms — folio.css
   "The Folio" — a flickable deck of full-screen pages.
   No document scrolling: a flick turns the page.
   ============================================================ */

:root {
  --ink: #e9efed;
  --ink-dim: #9db0aa;
  --ink-faint: #6b7d77;
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.08);

  --gold: #ffc46b;
  --aqua: #51d6ff;
  --leaf: #8fd96b;
  --rose: #ff9a8c;

  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", "Segoe UI", sans-serif;

  --flip: 0.85s cubic-bezier(0.77, 0, 0.18, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* the deck flips; the document never scrolls */
  overscroll-behavior: none;
}

body {
  background: #0b0f12;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--aqua); color: #04222e; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); margin: 0; }

.no-copy { -webkit-user-drag: none; user-select: none; }

/* ------------------------------------------------------------
   Atmosphere (crossfades per page)
   ------------------------------------------------------------ */

.phase {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0;
  transition: opacity 1.4s ease;
  pointer-events: none;
}

.phase-dawn {
  background:
    radial-gradient(120% 80% at 50% 110%, rgba(255, 140, 66, 0.28), transparent 55%),
    radial-gradient(90% 60% at 80% -10%, rgba(81, 100, 255, 0.18), transparent 60%),
    linear-gradient(180deg, #131129 0%, #1d1633 55%, #2a1a30 100%);
}

.phase-grove {
  background:
    radial-gradient(110% 70% at 15% 0%, rgba(143, 217, 107, 0.12), transparent 55%),
    radial-gradient(90% 70% at 90% 100%, rgba(255, 196, 107, 0.10), transparent 60%),
    linear-gradient(180deg, #0e1810 0%, #13200f 100%);
}

.phase-sea {
  background:
    radial-gradient(110% 80% at 80% 10%, rgba(81, 214, 255, 0.14), transparent 55%),
    radial-gradient(120% 90% at 20% 110%, rgba(0, 90, 130, 0.35), transparent 60%),
    linear-gradient(180deg, #051a24 0%, #07303e 100%);
}

.phase-earth {
  background:
    radial-gradient(110% 80% at 20% 0%, rgba(143, 217, 107, 0.13), transparent 55%),
    radial-gradient(110% 80% at 90% 100%, rgba(120, 80, 40, 0.25), transparent 60%),
    linear-gradient(180deg, #101a0c 0%, #1d2410 100%);
}

.phase-night {
  background:
    radial-gradient(100% 70% at 50% 0%, rgba(110, 120, 255, 0.10), transparent 60%),
    linear-gradient(180deg, #07080f 0%, #0d0e1a 100%);
}

body[data-phase="dawn"]  .phase-dawn,
body[data-phase="grove"] .phase-grove,
body[data-phase="sea"]   .phase-sea,
body[data-phase="earth"] .phase-earth,
body[data-phase="night"] .phase-night { opacity: 1; }

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

/* ------------------------------------------------------------
   Chrome: brand, dots, counter, hint
   ------------------------------------------------------------ */

.brand {
  position: fixed;
  top: 14px; left: 14px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 13px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 14, 16, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none;
  transition: border-color 0.3s;
  cursor: pointer;
}

.brand:hover { border-color: rgba(255, 196, 107, 0.5); }

.brand img {
  width: 26px; height: 26px; /* deliberately small on every screen */
  border-radius: 50%;
  object-fit: cover;
}

.brand span {
  font-family: var(--serif);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.dots {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dots a {
  position: relative;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid var(--ink-faint);
  transition: background 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.dots a::after {
  content: attr(data-label);
  position: absolute;
  right: 21px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: rgba(10, 14, 16, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.25s;
}

.dots a:hover::after { opacity: 1; }

.dots a.active {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.35);
  box-shadow: 0 0 14px rgba(255, 196, 107, 0.65);
}

.counter {
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 50;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.counter .cur { color: var(--gold); font-weight: 600; }
.counter .name { margin-left: 12px; color: var(--ink-faint); }

.hint {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(10, 14, 16, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-dim);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, opacity 0.4s;
}

.hint:hover { color: var(--gold); border-color: rgba(255, 196, 107, 0.5); }
.hint i { animation: bob 2s ease-in-out infinite; }
.hint.end { transform: translateX(-50%) rotate(180deg); }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* ------------------------------------------------------------
   The deck
   ------------------------------------------------------------ */

.deck {
  height: 100svh;
  overflow: hidden;
}

.track {
  height: 100%;
  transition: transform var(--flip);
  will-change: transform;
}

.page {
  height: 100svh;
  position: relative;
  overflow: hidden;
}

.page-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0.2;
  transform: scale(0.96);
  transition: opacity var(--flip), transform var(--flip);
}

.page.active .page-inner {
  opacity: 1;
  transform: scale(1);
}

/* Inner scroll area — only used if a page's content can't fit */
.page-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: clamp(64px, 9vh, 96px) clamp(18px, 4vw, 48px) clamp(70px, 9vh, 90px);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}

.page-content {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

/* Per-page reveal choreography */
.rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: 0s;
}

.page.active .rv {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(0.35s + var(--d, 0s));
}

/* ------------------------------------------------------------
   Page headers
   ------------------------------------------------------------ */

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent, var(--gold));
  margin: 0;
}

.kicker::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--accent, var(--gold));
}

.page-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;          /* room for descenders — gradient text clips below the line box */
  padding-bottom: 0.12em;
  margin: 10px 0 0;
  background: linear-gradient(150deg, #fff 40%, var(--accent, var(--gold)));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: var(--ink-dim);
  margin: 0 0 clamp(18px, 3vh, 34px);
}

#mission  { --accent: var(--gold); }
#aquatics { --accent: var(--aqua); }
#agronomy { --accent: var(--leaf); }
#news     { --accent: var(--rose); }
#connect  { --accent: var(--gold); }

/* ------------------------------------------------------------
   Page 1 — Dawn (hero)
   ------------------------------------------------------------ */

#top .page-scroll {
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  /* Opens dark and pulled back, then zooms in as the day breaks */
  transform: scale(1);
  filter: brightness(0.72) saturate(1.05);
  animation: daybreak 8s 1.6s cubic-bezier(0.25, 0.5, 0.25, 1) forwards;
}

@keyframes daybreak {
  to {
    transform: scale(1.18);
    filter: brightness(1.28) saturate(1.15);
  }
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(80% 65% at 50% 45%, rgba(8, 8, 18, 0.45), rgba(8, 8, 18, 0.85) 90%),
    linear-gradient(180deg, rgba(8, 8, 18, 0.5), transparent 35%, transparent 60%, rgba(8, 8, 18, 0.94));
  animation: veil-lift 8s 1.6s cubic-bezier(0.25, 0.5, 0.25, 1) forwards;
}

@keyframes veil-lift {
  to { opacity: 0.38; }
}

.hero-logo {
  width: clamp(64px, 9vw, 96px); /* visible on small, restrained on large */
  height: auto;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.05), 0 0 44px rgba(255, 196, 107, 0.35);
}

.hero-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

#top h1 {
  font-size: clamp(2.7rem, 8vw, 5.6rem);
  line-height: 1.1;
  padding-bottom: 0.1em;
  /* Tall gradient: pale tones at the top, deep sunset ambers at the bottom.
     As the background brightens, the window slides down into the deep tones. */
  background: linear-gradient(180deg,
    #ffffff 0%, #ffe9c9 22%, #ffc46b 48%, #e8923d 72%, #a14d18 100%);
  background-size: 100% 340%;
  background-position: 50% 0%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-deepen 8s 1.6s cubic-bezier(0.25, 0.5, 0.25, 1) forwards;
}

@keyframes title-deepen {
  to {
    background-position: 50% 100%;
    text-shadow: 0 2px 34px rgba(15, 8, 0, 0.6);
  }
}

.hero-tagline {
  margin-top: 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--ink-dim);
  animation: tagline-warm 8s 1.6s cubic-bezier(0.25, 0.5, 0.25, 1) forwards;
}

@keyframes tagline-warm {
  to {
    color: #ffdcae;
    text-shadow: 0 1px 14px rgba(15, 8, 0, 0.75);
  }
}

.hero-cue {
  margin-top: 34px;
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------
   Page 2 — Mission + tenets
   ------------------------------------------------------------ */

.lede {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.1vw, 1.5rem);
  line-height: 1.5;
  max-width: 46em;
  margin: 0 0 clamp(18px, 3.2vh, 36px);
}

.lede em { font-style: italic; color: var(--gold); }

.tenets-head {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 16px;
}

.tenets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tenet {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 12px;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, background 0.3s;
}

.tenet:hover {
  transform: translateY(-4px);
  background: var(--glass-2);
  border-color: rgba(255, 196, 107, 0.5);
}

.tenet .num {
  position: absolute;
  top: 4px; right: 12px;
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.06);
}

.tenet h3 {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--gold);
}

.tenet h3 i { margin-right: 8px; }

.tenet p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 6px;
}

/* ------------------------------------------------------------
   Pages 3 & 4 — galleries (tile wall, fits one screen)
   ------------------------------------------------------------ */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tiles figure {
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

.tiles img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.55s;
  filter: saturate(0.95);
}

.tiles figure:hover img {
  transform: scale(1.07);
  filter: saturate(1.12);
}

.tiles figure::after {
  content: "\2726"; /* ✦ */
  position: absolute;
  right: 10px; bottom: 8px;
  color: #fff;
  opacity: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  transition: opacity 0.3s;
}

.tiles figure:hover::after { opacity: 0.9; }

/* ------------------------------------------------------------
   Page 5 — dispatches
   ------------------------------------------------------------ */

.dispatches { display: grid; gap: 10px; }

.entry {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: baseline;
  padding: 13px 20px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  transition: transform 0.3s, border-color 0.3s, background 0.3s;
}

.entry:hover {
  transform: translateX(8px);
  background: var(--glass-2);
  border-color: rgba(255, 154, 140, 0.5);
}

.entry time {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.entry h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.4;
  margin: 0;
}

.entry:hover h3 { color: var(--rose); }

.entry p {
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin: 4px 0 0;
}

.entry .src {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.entry .src i { margin-right: 6px; color: var(--rose); }

/* ------------------------------------------------------------
   Page 6 — connect
   ------------------------------------------------------------ */

#connect .page-scroll {
  display: grid;
  place-items: center;
  text-align: center;
}

#connect .sig {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  color: var(--ink);
  margin: 0 0 30px;
}

.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.socials i {
  width: 48px; height: 48px;
  line-height: 48px !important;
  font-size: 19px !important;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-dim);
  cursor: pointer;
  transition: transform 0.3s, color 0.3s, border-color 0.3s, background 0.3s;
}

.socials i:hover {
  transform: translateY(-5px) rotate(6deg);
  color: #fff;
  border-color: var(--gold);
  background: rgba(255, 196, 107, 0.1);
}

#connect .fin {
  margin-top: 34px;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(4, 6, 10, 0.93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.lightbox.open { display: grid; }

.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
  animation: lbin 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes lbin {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 980px) {
  .tenets { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  body { font-size: 15px; }

  /* Brand stays visible — logo always on screen, just compact */
  .brand span { display: none; }

  .tenets { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .entry {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 16px;
  }
  .entry:hover { transform: none; }

  .dots { right: 10px; gap: 13px; }
  .dots a { width: 8px; height: 8px; }
  .dots a::after { display: none; }

  .counter .name { display: none; }

  .page-scroll {
    padding-top: 62px;
    padding-bottom: 64px;
  }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .track, .page-inner { transition: none; }
  .hero-bg, .hero-veil, #top h1, .hero-tagline, .hint i { animation: none; }
  .hero-bg { transform: none; filter: brightness(0.95) saturate(1.05); }
  .rv, .page.active .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .phase { transition: none; }
}
