/* FileFlow — fileflow.cc
   Aesthetic: Japanese ink-wash (sumi-e) editorial minimalism.
   Rice-paper ground, indigo ink, a single vermillion sun. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..600;1,9..144,300..500&family=Newsreader:ital,opsz,wght@0,6..72,300..500;1,6..72,300..420&family=Spline+Sans+Mono:wght@400;500&display=swap');

:root {
  --paper:      #f3ebe0;
  --paper-deep: #e9ddcd;
  --paper-edge: #ddcdb8;
  --ink:        #17233c;
  --ink-soft:   #34415e;
  --mist:       #8a93a8;
  --mist-soft:  #aab1c1;
  --sun:        #d4523a;
  --sun-deep:   #b8402a;

  --serif:   'Newsreader', Georgia, 'Times New Roman', serif;
  --display: 'Fraunces', Georgia, serif;
  --mono:    'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --measure: 34rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 18px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Atmosphere: the rising sun, mist, and paper grain ──────────────── */

/* Soft vermillion sun, high and to the right — echoing the icon. */
body::before {
  content: '';
  position: fixed;
  top: -16vh; right: -10vw;
  width: 60vmin; height: 60vmin;
  border-radius: 50%;
  background: radial-gradient(circle at center,
      rgba(212, 82, 58, 0.16) 0%,
      rgba(212, 82, 58, 0.10) 38%,
      rgba(212, 82, 58, 0) 68%);
  pointer-events: none;
  z-index: 0;
  animation: sun-rise 2.4s var(--ease) both;
}

/* Fine paper grain over everything. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

/* Layered ink-wash mountains pinned to the bottom of the page. */
.mountains {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 32vh;
  min-height: 190px;
  z-index: 0;
  pointer-events: none;
  animation: mist-in 2.8s var(--ease) 0.3s both;
}
.mountains svg { width: 100%; height: 100%; display: block; }

/* Reading pages: keep the mist a faint flourish so it never fights body text. */
.mountains.faint {
  height: 22vh;
  animation: mist-in-faint 2.8s var(--ease) 0.3s both;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.hero {
  flex: 1;
  /* vw-based cap references the viewport directly, immune to any odd
     containing-block width. */
  max-width: min(36rem, 90vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.6rem;
  padding: 4vh 0 8vh;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--mist);
}
.eyebrow .dot { color: var(--sun); }

.icon {
  width: clamp(116px, 17vmin, 168px);
  height: auto;
  filter: drop-shadow(0 18px 36px rgba(23, 35, 60, 0.22));
  transition: transform 0.6s var(--ease);
}
.icon:hover { transform: translateY(-4px) rotate(-0.6deg); }

.wordmark {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 380;
  font-size: clamp(3.4rem, 12vw, 7rem);
  line-height: 0.92;
  letter-spacing: -0.018em;
  color: var(--ink);
}
.wordmark .flow { font-style: italic; font-weight: 340; }

.tagline {
  font-family: var(--display);
  font-weight: 340;
  font-size: clamp(1.15rem, 3.4vw, 1.6rem);
  font-style: italic;
  color: var(--sun-deep);
  letter-spacing: 0.005em;
}

.lede {
  max-width: min(var(--measure), 90vw);
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  color: var(--ink-soft);
  line-height: 1.7;
  text-wrap: pretty;
}
.lede em { font-style: italic; color: var(--ink); }

/* Hand-inked divider: a small winding river that draws itself. */
.river {
  width: clamp(120px, 22vw, 200px);
  height: 26px;
  margin-top: 0.4rem;
  overflow: visible;
}
.river path {
  fill: none;
  stroke: var(--mist);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  animation: draw 2.2s var(--ease) 1.1s both;
}
.river .drop {
  fill: var(--sun);
  opacity: 0;
  animation: fade-in 0.8s var(--ease) 2.9s both;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem 1.4rem;
  /* Sit clear of the mist ridge, and read on whatever's behind. */
  margin-top: auto;
  padding: 2rem 0 max(2.5rem, 8vh);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.footer > span:first-child { color: var(--ink-soft); }
.footer a {
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease);
}
.footer a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--sun);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.footer a:hover { color: var(--ink); }
.footer a:hover::after { transform: scaleX(1); }
.footer .sep { color: var(--paper-edge); }

/* ── Reading pages (privacy / terms) ────────────────────────────────── */

.prose-page { padding: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 3rem); }

.prose {
  max-width: 40rem;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mist);
  text-decoration: none;
  margin-bottom: 3rem;
  transition: color 0.3s var(--ease);
}
.home-link:hover { color: var(--sun-deep); }
.home-link img { width: 26px; height: 26px; }

.prose h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}
.prose .updated {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--mist);
  margin-bottom: 2.6rem;
}
.prose h2 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 440;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 2.6rem 0 0.7rem;
  color: var(--ink);
}
.prose p, .prose li { color: var(--ink-soft); line-height: 1.72; }
.prose p { margin-bottom: 1rem; }
.prose ul { margin: 0 0 1rem 1.1rem; }
.prose li { margin-bottom: 0.45rem; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose a { color: var(--sun-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose .lead {
  font-family: var(--display);
  font-weight: 330;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 2rem;
}

.prose-footer {
  max-width: 40rem;
  margin: 4rem auto 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--paper-edge);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--mist);
}
.prose-footer a { color: var(--ink-soft); text-decoration: none; }
.prose-footer a:hover { color: var(--sun-deep); }

/* ── Page-load orchestration ────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(14px); animation: rise 1s var(--ease) both; }
.d1 { animation-delay: 0.15s; }
.d2 { animation-delay: 0.32s; }
.d3 { animation-delay: 0.52s; }
.d4 { animation-delay: 0.70s; }
.d5 { animation-delay: 0.88s; }
.d6 { animation-delay: 1.10s; }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes sun-rise {
  from { opacity: 0; transform: translateY(28px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes mist-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mist-in-faint { from { opacity: 0; } to { opacity: 0.5; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .river path { stroke-dashoffset: 0; }
  .river .drop { opacity: 1; }
}
