/* =========================================================
   Fairware — style.css
   Palette: warm paper + deep blue accent
   Typography: Fraunces (display) / Inter (body) / JetBrains Mono (accents)
   ========================================================= */

:root {
  /* Colors */
  --paper: #f5f1ea;
  --paper-2: #ede7db;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --ink-mute: #6b6b6b;
  --rule: #d9d2c3;
  --accent: #0a2540;        /* deep blue */
  --accent-hi: #1e3a8a;     /* lighter deep blue for hover */
  --accent-wash: #0a25400d; /* 5% alpha */

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --container: 1120px;
  --gutter: clamp(20px, 4vw, 48px);
}

/* --- Reset-ish --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; max-width: 100%; }

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

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor { animation: none; }
}

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

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Mono tag (tech-savvy accent label) --- */
.mono-tag {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  text-transform: lowercase;
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--paper);
  border-radius: 6px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  transform: translateY(4px);
  margin-right: 2px;
}
.brand-dot { color: var(--accent); }
.brand-name { color: var(--ink); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
}
.nav-links a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-github { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 640px) {
  .nav-links a:not(.nav-github) { display: none; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding: clamp(80px, 14vh, 160px) 0 clamp(80px, 12vh, 140px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  /* diagonal accent line, bottom-right */
  content: "";
  position: absolute;
  right: -80px;
  bottom: 40px;
  width: 360px;
  height: 1px;
  background: var(--accent);
  opacity: 0.25;
  transform: rotate(-32deg);
}
.hero-label { margin-bottom: 28px; }

.hero-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(44px, 9vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 32px;
}
.hero-title .accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
  display: inline-block;
  position: relative;
}
.cursor {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 500;
  font-style: normal;
  color: var(--accent);
  animation: blink 1.1s steps(2, start) infinite;
  margin-left: 4px;
  transform: translateY(-0.1em);
}
@keyframes blink { to { visibility: hidden; } }

.hero-sub {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 620px;
  margin-bottom: 40px;
  font-weight: 400;
}
.hero-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

/* =========================================================
   SECTION HEADER (shared)
   ========================================================= */
.section-header {
  margin-bottom: clamp(40px, 6vw, 72px);
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  max-width: 720px;
}
.section-header .mono-tag {
  display: block;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 12px;
}
.section-lede {
  font-family: var(--serif);
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-mute);
  font-style: italic;
}

/* =========================================================
   PROMISE / PRINCIPLES
   ========================================================= */
.promise { padding: clamp(60px, 10vh, 120px) 0; }
.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.principle {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(24px, 3.5vw, 36px) 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
  transition: background 0.2s ease, padding-left 0.2s ease;
  padding-left: 12px;
  margin-left: -12px;
  padding-right: 12px;
  margin-right: -12px;
}
.principle:hover {
  background: var(--accent-wash);
}
.principle-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  padding-top: 6px;
  letter-spacing: 0.05em;
}
.principle-body h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.principle-body p {
  font-size: clamp(15px, 1.3vw, 17px);
  color: var(--ink-soft);
  max-width: 620px;
}

@media (max-width: 540px) {
  .principle { grid-template-columns: 48px 1fr; gap: 16px; }
}

/* =========================================================
   WHY — prose
   ========================================================= */
.why {
  padding: clamp(60px, 10vh, 120px) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.prose {
  max-width: 680px;
  font-family: var(--serif);
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.55;
  color: var(--ink-soft);
}
.prose p { margin-bottom: 24px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong {
  color: var(--accent);
  font-weight: 700;
}
.prose-closer {
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 26px) !important;
  color: var(--ink) !important;
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin-top: 40px !important;
}

/* =========================================================
   PRODUCTS
   ========================================================= */
.products { padding: clamp(60px, 10vh, 120px) 0; }
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.product-card {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px;
  background: var(--paper);
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.product-card .mono-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-wash);
  border-radius: 4px;
  color: var(--accent);
  margin-bottom: 20px;
}
.product-card h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--ink);
}
.product-card p {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 20px;
}
.product-card--empty::after {
  /* dashed corner flag */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 12px;
  border: 1px dashed var(--accent);
  opacity: 0.2;
  pointer-events: none;
}

.link-arrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}
.link-arrow:hover { gap: 8px; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(48px, 8vh, 80px) 0 24px;
  margin-top: 0;
}
.footer .mono-tag { color: #8a8a8a; display: block; margin-bottom: 8px; }
.footer a { color: var(--paper); transition: color 0.15s ease; }
.footer a:hover { color: #9ab8e8; }

.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid #2a2a2a;
}
.footer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 16px;
}
.footer-brand .brand-mark {
  background: var(--paper);
  color: var(--ink);
}
.footer-brand .brand-dot { color: #9ab8e8; }
.footer-note {
  font-family: var(--serif);
  font-style: italic;
  color: #a8a8a8;
  max-width: 420px;
  font-size: 17px;
  line-height: 1.5;
}
.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.footer-col a {
  font-family: var(--mono);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom .mono-tag { margin-bottom: 0; }

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: 1fr; gap: 20px; }
}
