/* FlowIntel — Creating a better tomorrow.
   A quiet, editorial single-page site.
   Set in Fraunces (display) & Inter Tight (body), with JetBrains Mono for marginalia.
*/

:root {
  --paper: #f3eee5;
  --paper-deep: #ece5d6;
  --ink: #161614;
  --ink-soft: #2a2925;
  --ink-mute: #6e6a60;
  --rule: #c9c0ad;
  --accent: #b6411a; /* burnt sienna */
  --accent-soft: #e8b8a3;
  --leaf: #4a5d3a;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --max: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "ss02", "cv11";
  letter-spacing: -0.005em;
  position: relative;
  overflow-x: hidden;
}

/* Soft paper grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Nav ---------- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 28px var(--gutter) 0;
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.mark {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
}

.mark__glyph {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.mark__glyph em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

.mark__word {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-bottom: 2px;
}

.nav nav ul {
  display: flex;
  gap: 32px;
}
.nav nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  transition: color 0.3s ease;
  position: relative;
}
.nav nav a:hover {
  color: var(--ink);
}
.nav nav a.cta {
  color: var(--ink);
}
.nav nav a.cta::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav nav a.cta:hover::after {
  transform: scaleX(0.6);
}

@media (max-width: 720px) {
  .nav nav ul {
    gap: 18px;
  }
  .nav nav li:not(:last-child) {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 12vw, 130px) var(--gutter) clamp(80px, 14vw, 160px);
  position: relative;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(40px, 7vw, 64px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  opacity: 0;
  animation: rise 1s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(182, 65, 26, 0.18);
  animation: breathe 3.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(182, 65, 26, 0.18);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(182, 65, 26, 0.06);
  }
}

.hero__title {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-size: clamp(56px, 12.5vw, 196px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--ink);
  margin-bottom: clamp(64px, 9vw, 110px);
}

.hero__title .line {
  display: block;
  overflow: hidden;
}
.hero__title .line > * {
  display: inline-block;
}
.hero__title .line {
  opacity: 0;
  transform: translateY(0.5em);
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero__title .line:nth-child(1) { animation-delay: 0.18s; }
.hero__title .line:nth-child(2) { animation-delay: 0.32s; }
.hero__title .line:nth-child(3) { animation-delay: 0.46s; }
.hero__title .line:nth-child(4) { animation-delay: 0.6s; }

.hero__title .line--italic {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
  margin-left: clamp(40px, 9vw, 180px);
}

.hero__title .line--small {
  font-size: 0.32em;
  font-style: italic;
  color: var(--ink-mute);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-top: 0.6em;
  margin-left: clamp(40px, 9vw, 180px);
  font-variation-settings: "opsz" 14;
}

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

.hero__base {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
  border-top: 1px solid var(--rule);
  padding-top: clamp(28px, 4vw, 44px);
  opacity: 0;
  animation: rise 1s 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.hero__lede {
  font-family: var(--serif);
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.45;
  font-weight: 300;
  letter-spacing: -0.01em;
  max-width: 38ch;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 28;
}

.hero__index {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: right;
}

.hero__index ol {
  display: grid;
  gap: 8px;
}
.hero__index li {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}
.hero__index span {
  color: var(--accent);
  font-style: italic;
  font-family: var(--serif);
  text-transform: lowercase;
  letter-spacing: 0;
  font-size: 13px;
}

@media (max-width: 720px) {
  .hero__base {
    grid-template-columns: 1fr;
  }
  .hero__index {
    text-align: left;
  }
  .hero__index li {
    justify-content: flex-start;
  }
}

/* Decorative rule beneath hero */
.hero__rule {
  position: absolute;
  bottom: clamp(40px, 8vw, 90px);
  right: var(--gutter);
  display: flex;
  gap: 6px;
  opacity: 0;
  animation: rise 1s 1.2s ease forwards;
}
.hero__rule span {
  width: 28px;
  height: 1px;
  background: var(--ink-mute);
  display: block;
}
.hero__rule span:nth-child(2) { width: 44px; }
.hero__rule span:nth-child(3) { width: 18px; }

/* ---------- Section tag ---------- */
.section__tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 32px;
}
.section__tag em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0;
  margin-right: 10px;
  font-size: 14px;
}

/* ---------- Thesis ---------- */
.thesis {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--gutter);
  border-top: 1px solid var(--rule);
}

.thesis__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(40px, 7vw, 100px);
  align-items: start;
}

.thesis__pull {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 144;
  font-size: clamp(30px, 4.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.thesis__pull em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

.thesis__body {
  font-family: var(--serif);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.65;
  color: var(--ink-soft);
  font-weight: 300;
  font-variation-settings: "opsz" 24;
  display: grid;
  gap: 1em;
  padding-top: 0.4em;
  max-width: 38ch;
}

@media (max-width: 820px) {
  .thesis__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Practice / cards ---------- */
.practice {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--gutter);
  border-top: 1px solid var(--rule);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.card {
  background: var(--paper);
  padding: clamp(28px, 3.4vw, 44px);
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 280px;
  transition: background 0.5s ease;
  position: relative;
}
.card:hover {
  background: var(--paper-deep);
}
.card:hover .card__num {
  color: var(--accent);
}

.card__num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.18em;
  transition: color 0.4s ease;
}

.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(28px, 2.8vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variation-settings: "opsz" 144;
}

.card p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 32ch;
  font-variation-settings: "opsz" 14;
}

@media (max-width: 820px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .card {
    min-height: 0;
  }
}

/* ---------- Almanac ---------- */
.almanac {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--gutter);
  border-top: 1px solid var(--rule);
}

.almanac__head h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 144;
  font-size: clamp(36px, 5.5vw, 80px);
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 14ch;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.almanac__head h2 em {
  font-style: italic;
  color: var(--accent);
}

.entries {
  border-top: 1px solid var(--rule);
}
.entries li {
  display: grid;
  grid-template-columns: 110px 1.4fr 2fr auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.4s ease;
}
.entries li:hover {
  padding-left: 14px;
  padding-right: 14px;
  background: var(--paper-deep);
}
.entries li:hover .arrow {
  transform: translateX(8px);
  color: var(--accent);
}

.entries time {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

.entries h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.018em;
  font-variation-settings: "opsz" 36;
}

.entries p {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-mute);
  font-size: 15px;
  line-height: 1.45;
  font-variation-settings: "opsz" 14;
}

.arrow {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink-mute);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s ease;
}

@media (max-width: 820px) {
  .entries li {
    grid-template-columns: 90px 1fr auto;
  }
  .entries p {
    display: none;
  }
}

/* ---------- Letters ---------- */
.letters {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--gutter);
  border-top: 1px solid var(--rule);
}

.letters__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.letters__inner h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 144;
  font-size: clamp(38px, 5.5vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
.letters__inner h2 em {
  font-style: italic;
  color: var(--accent);
}

.letters__inner > p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 18;
  max-width: 50ch;
  margin: 0 auto 44px;
}

.letters__form {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 480px;
  margin: 0 auto;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 12px;
  transition: border-color 0.3s ease;
}
.letters__form:focus-within {
  border-color: var(--accent);
}

.letters__form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  padding: 8px 0;
  font-style: italic;
  font-weight: 300;
}
.letters__form input::placeholder {
  color: var(--ink-mute);
  font-style: italic;
}

.letters__form button {
  background: transparent;
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 8px 0 8px 18px;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.letters__form button:hover {
  color: var(--accent);
  transform: translateX(3px);
}

/* ---------- Footer ---------- */
.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 100px) var(--gutter) 40px;
  border-top: 1px solid var(--rule);
}

.foot__top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 5vw, 60px);
  align-items: baseline;
  padding-bottom: clamp(40px, 6vw, 70px);
  border-bottom: 1px solid var(--rule);
}

.foot__mark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(36px, 6vw, 76px);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.foot__mark span {
  font-size: 0.3em;
  vertical-align: super;
  color: var(--accent);
  font-style: normal;
  margin-left: 4px;
}

.foot__tag {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(16px, 1.6vw, 22px);
  color: var(--ink-mute);
  max-width: 28ch;
  justify-self: end;
  text-align: right;
  font-variation-settings: "opsz" 18;
}

@media (max-width: 720px) {
  .foot__top {
    grid-template-columns: 1fr;
  }
  .foot__tag {
    justify-self: start;
    text-align: left;
  }
}

.foot__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 4vw, 50px);
  padding: clamp(40px, 5vw, 60px) 0;
}

.foot__h {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
}

.foot__cols ul {
  display: grid;
  gap: 8px;
}
.foot__cols li,
.foot__cols a {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 14;
}
.foot__cols a {
  position: relative;
  transition: color 0.3s ease;
}
.foot__cols a:hover {
  color: var(--accent);
}

@media (max-width: 720px) {
  .foot__cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

.foot__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: clamp(30px, 4vw, 40px);
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.foot__star {
  color: var(--accent);
  font-size: 14px;
}

@media (max-width: 720px) {
  .foot__bottom {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
