/* ============================================
   Ory Valin — valin.cc
   Minimalist Monochrome — Editorial Design
   ============================================ */

/* --- Reset & Custom Properties --- */

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

:root {
  --color-bg:         #F8F9FB;
  --color-fg:         #1C2333;
  --color-muted:      #EEF1F5;
  --color-muted-fg:   #4A5568;
  --color-faint:      #8896A8;
  --color-border:     #E3E8EF;
  --color-border-dark:#1C2333;
  --color-navy:       #1B3A5C;
  --color-navy-soft:  #2D5A8A;
  --color-navy-wash:  #D6E4F0;
  --color-stone:      #5C5248;
  --color-stone-wash: #F0EDE8;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', monospace;

  --max-content: 1152px;
  --margin-x: clamp(24px, 5vw, 48px);
}

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.625;
  color: var(--color-fg);
  background: var(--color-bg);
  position: relative;
}

/* Subtle noise texture for paper-like quality */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.02;
  z-index: 9999;
}

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

img {
  max-width: 100%;
  display: block;
}

/* --- Typography --- */

h1, h2, h3 {
  font-family: var(--font-display);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.05;
  color: var(--color-fg);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--color-fg);
  margin-bottom: 24px;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--color-fg);
}

.body-lg {
  font-size: 1.25rem;
  line-height: 1.625;
  color: var(--color-muted-fg);
}

.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-fg);
  margin-bottom: 16px;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Navigation --- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 20px var(--margin-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-fg);
  letter-spacing: -0.025em;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-fg);
  transition: color 100ms;
}

.nav-links a:hover {
  color: var(--color-fg);
}

/* --- Hero --- */

.hero {
  padding: 180px var(--margin-x) 0;
  max-width: var(--max-content);
  margin: 0 auto;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 64px;
  align-items: end;
  padding-bottom: 80px;
  border-bottom: 3px solid var(--color-navy);
}

.hero-text {
  max-width: 800px;
}

.hero-text .label {
  margin-bottom: 24px;
}

.hero-text h1 {
  margin-bottom: 32px;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: 1.625;
  color: var(--color-muted-fg);
  max-width: 560px;
  margin-bottom: 48px;
}

.hero-aside {
  text-align: left;
  padding-bottom: 8px;
  border-left: 3px solid var(--color-navy);
  padding-left: 24px;
}

.hero-numeral {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5rem, 10vw, 8rem);
  line-height: 0.85;
  color: var(--color-navy);
  letter-spacing: -0.05em;
}

.hero-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-fg);
  margin-top: 16px;
}

/* --- Buttons --- */

.btn-primary {
  display: inline-block;
  background: var(--color-navy);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 32px;
  border: 2px solid var(--color-navy);
  border-radius: 0;
  transition: background 100ms, color 100ms;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--color-bg);
  color: var(--color-navy);
}

/* --- Sections --- */

.section {
  padding: 80px var(--margin-x);
}

.section-inner {
  max-width: 800px;
  margin: 0 auto;
}

/* Rule between sections */
.section + .section {
  border-top: 1px solid var(--color-border);
}

.section.stats-section + .section {
  border-top: none;
}

/* --- About layout --- */

.about-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 80px;
  align-items: start;
  max-width: var(--max-content);
}

.about-text p {
  color: var(--color-muted-fg);
  margin-top: 20px;
  line-height: 1.625;
}

.about-text .body-lg {
  margin-top: 0;
}

.about-aside {
  padding-top: 56px;
  position: sticky;
  top: 100px;
  border-left: 2px solid var(--color-navy);
  padding-left: 24px;
}

.aside-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
  color: var(--color-navy);
  letter-spacing: -0.025em;
}

.aside-rule {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: 24px 0;
}

/* --- Stats --- */

.stats-section {
  background: var(--color-navy);
  color: #fff;
  border-top: none;
  position: relative;
  overflow: hidden;
}

/* Vertical line texture on dark bg */
.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 1px,
    #fff 1px,
    #fff 2px
  );
  background-size: 4px 100%;
  opacity: 0.03;
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  max-width: var(--max-content);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat .mono-label {
  color: rgba(255, 255, 255, 0.5);
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1;
  color: #fff;
  letter-spacing: -0.025em;
}

.stat-context {
  font-family: var(--font-body);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
}

/* --- Timeline --- */

.timeline {
  margin-top: 48px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
}

.timeline-item:last-child {
  border-bottom: 1px solid var(--color-border);
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.timeline-body h3 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.timeline-org {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-muted-fg);
  margin-bottom: 12px;
}

.timeline-body p:last-child {
  color: var(--color-muted-fg);
  font-size: 1rem;
  line-height: 1.625;
}

/* --- Approach --- */

.approach-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 48px;
}

.approach-card {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  transition: background 100ms, color 100ms;
}

.approach-card:last-child {
  border-bottom: 1px solid var(--color-border);
}

.approach-card:hover {
  background: var(--color-navy);
  color: #fff;
  padding-left: 24px;
  padding-right: 24px;
  margin-left: -24px;
  margin-right: -24px;
}

.approach-card:hover h3 {
  color: #fff;
}

.approach-card:hover .mono-label {
  color: rgba(255, 255, 255, 0.5);
}

.approach-card:hover p {
  color: rgba(255, 255, 255, 0.7);
}

.approach-card .mono-label {
  display: block;
  margin-bottom: 12px;
  transition: color 100ms;
}

.approach-card h3 {
  margin-bottom: 8px;
}

.approach-card p {
  color: var(--color-muted-fg);
  font-size: 1rem;
  line-height: 1.625;
  max-width: 600px;
  transition: color 100ms;
}

/* --- Quote --- */

.quote-section {
  background: var(--color-stone-wash);
  position: relative;
}

/* Diagonal line texture */
.quote-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    #00000008 40px,
    #00000008 42px
  );
  opacity: 0.5;
  pointer-events: none;
}

.pullquote {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  padding-left: 48px;
}

.pullquote::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 8rem;
  line-height: 0.5;
  color: var(--color-stone);
  opacity: 0.15;
  position: absolute;
  left: -8px;
  top: 16px;
}

.pullquote p {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  color: var(--color-fg);
  letter-spacing: -0.01em;
}

/* --- Connect --- */

.connect-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  max-width: var(--max-content);
}

.connect-text .body-lg {
  margin-top: 8px;
}

.connect-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 48px;
}

.connect-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid var(--color-border);
  transition: background 100ms, color 100ms;
}

.connect-link:last-child {
  border-bottom: 1px solid var(--color-border);
}

.connect-link:hover {
  background: var(--color-navy);
  color: #fff;
  padding-left: 16px;
  padding-right: 16px;
  margin-left: -16px;
  margin-right: -16px;
}

.connect-link:hover .connect-link-label {
  color: rgba(255, 255, 255, 0.5);
}

.connect-link:hover .connect-link-value {
  color: #fff;
}

.connect-link-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted-fg);
  transition: color 100ms;
}

.connect-link-value {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-fg);
  transition: color 100ms;
}

/* --- Footer --- */

.site-footer {
  padding: 32px var(--margin-x);
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-fg);
}

.footer-sep {
  color: var(--color-faint);
}

.footer-location {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-fg);
}

/* --- Scroll Reveal --- */

.js-reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.js-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item.js-reveal:nth-child(2) { transition-delay: 60ms; }
.timeline-item.js-reveal:nth-child(3) { transition-delay: 120ms; }

.stat.js-reveal:nth-child(2) { transition-delay: 60ms; }
.stat.js-reveal:nth-child(3) { transition-delay: 120ms; }

.approach-card.js-reveal:nth-child(2) { transition-delay: 60ms; }
.approach-card.js-reveal:nth-child(3) { transition-delay: 120ms; }
.approach-card.js-reveal:nth-child(4) { transition-delay: 180ms; }

.aside-stat.js-reveal:nth-child(3) { transition-delay: 60ms; }
.aside-stat.js-reveal:nth-child(5) { transition-delay: 120ms; }

.connect-link.js-reveal:nth-child(2) { transition-delay: 60ms; }

/* --- Responsive --- */

@media (max-width: 768px) {
  .hero {
    padding: 140px var(--margin-x) 0;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-aside {
    position: static;
    padding-top: 0;
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--color-border);
    padding-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .aside-rule {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .connect-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .connect-links {
    padding-top: 0;
  }

  .timeline-item {
    grid-template-columns: 60px 1fr;
    gap: 20px;
  }

  .nav-links {
    gap: 20px;
  }

  .approach-card:hover {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 0.6875rem;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-meta {
    flex-direction: row;
    gap: 12px;
    align-items: center;
  }

  .about-aside {
    grid-template-columns: 1fr;
  }
}
