/* ─────────────────────────────────────────────
   RWYIV — style.css
   Fonts: Syne (display) · Instrument Serif · Space Mono
   ───────────────────────────────────────────── */

:root {
  --bg:           #141418;
  --bg-elevated:  #1C1C22;
  --text-primary: #E6E2DC;
  --text-secondary: #918D87;
  --text-muted:   #5E5B56;
  --accent:       #0047AB;
  --accent-glow:  rgba(0, 71, 171, 0.18);
  --accent-soft:  #2B6CC4;
  --border:       rgba(230, 226, 220, 0.08);
  --font-display: 'Syne', sans-serif;
  --font-serif:   'Instrument Serif', serif;
  --font-mono:    'Space Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-display);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ── GRAIN OVERLAY ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

/* ── PRELOADER ── */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}
.preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 10vw, 120px);
  letter-spacing: 0.15em;
  color: var(--text-primary);
  opacity: 0;
  animation: fadeUp 0.6s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  mix-blend-mode: difference;
}

.nav-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2em;
  color: #fff;
  text-decoration: none;
}

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

.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: #fff;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* ── HERO (homepage) ── */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 40px 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.6;
}

.hero-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(80px, 18vw, 280px);
  letter-spacing: 0.06em;
  line-height: 0.85;
  color: var(--text-primary);
  position: relative;
  opacity: 0;
  animation: heroReveal 1.2s 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-wordmark .accent-letter {
  color: var(--accent);
  display: inline-block;
  position: relative;
}

.hero-wordmark .accent-letter::after {
  content: '';
  position: absolute;
  bottom: 0.05em; left: 0;
  width: 100%; height: 0.06em;
  background: var(--accent);
  opacity: 0.4;
}

@keyframes heroReveal {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 2.5vw, 32px);
  color: var(--text-secondary);
  margin-top: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-scroll {
  position: absolute;
  right: 40px; bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeUp 0.8s 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-scroll span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  writing-mode: vertical-lr;
}

.scroll-line {
  width: 1px; height: 40px;
  background: var(--text-muted);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%   { top: -100%; }
  50%  { top: 100%; }
  100% { top: 100%; }
}

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  padding: 160px 40px 80px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.page-hero .hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 20% 60%, var(--accent-glow), transparent 70%);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(48px, 8vw, 120px);
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
}

.page-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 2vw, 24px);
  color: var(--text-secondary);
  margin-top: 16px;
  position: relative;
  max-width: 600px;
}

/* ── SECTIONS (shared) ── */
.section {
  padding: 120px 40px;
  position: relative;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-label::before {
  content: '';
  width: 40px; height: 1px;
  background: var(--accent);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 900px;
}

/* ── WORK GRID ── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin-top: 60px;
}

/* When used as <a> tag */
a.work-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.work-card {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-elevated);
}

.work-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.5;
  transition: opacity 0.6s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card-placeholder {
  width: 100%; height: 100%;
  background: var(--bg-elevated);
}

.work-card:hover .work-card-img { opacity: 0.8; transform: scale(1.04); }

.work-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  background: linear-gradient(to top, rgba(10,10,10,0.9) 0%, transparent 60%);
}

.work-card-discipline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.work-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.2;
  color: var(--text-primary);
}

.work-card-client {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.work-card .arrow-icon {
  position: absolute;
  top: 24px; right: 24px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(232, 228, 221, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translate(-8px, 8px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card:hover .arrow-icon { opacity: 1; transform: translate(0, 0); }

.arrow-icon svg {
  width: 14px; height: 14px;
  stroke: var(--text-primary);
  stroke-width: 2;
  fill: none;
}

/* ── DISCIPLINES ── */
.disciplines {
  display: flex;
  gap: 1px;
  margin-top: 80px;
  background: var(--border);
}

.discipline-col {
  flex: 1;
  padding: 40px 28px;
  background: var(--bg);
  position: relative;
  cursor: pointer;
  transition: background 0.4s;
}

.discipline-col:hover { background: var(--bg-elevated); }
.discipline-col:hover .disc-num { color: var(--accent); }

.disc-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: color 0.4s;
}

.disc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.disc-desc {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── FILTER TABS (work index) ── */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.filter-tab:hover,
.filter-tab.active {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ── JOURNAL LIST ── */
.journal-list {
  margin-top: 60px;
  border-top: 1px solid var(--border);
}

/* When used as <a> tag */
a.journal-item {
  text-decoration: none;
  color: inherit;
  display: grid;
}

.journal-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.3s, padding 0.3s, margin 0.3s;
}

.journal-item:hover {
  background: var(--bg-elevated);
  padding-left: 16px;
  padding-right: 16px;
  margin: 0 -16px;
}

.journal-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  min-width: 80px;
}

.journal-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}

.journal-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── ABOUT SPLIT ── */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  margin-top: 60px;
  align-items: start;
}

.about-text p {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.about-text p:first-child {
  font-size: 24px;
  color: var(--text-primary);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 20px;
}

.stat-block {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── PROJECT DETAIL HERO ── */
.project-hero {
  height: 70vh;
  min-height: 420px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elevated);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 60px 40px;
}

.project-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,20,24,0.96) 0%, rgba(20,20,24,0.4) 50%, transparent 100%);
}

.project-hero-content { position: relative; }

.project-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.project-discipline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-year {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

h1.project-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 80px);
  letter-spacing: -0.02em;
  line-height: 1;
}

.project-client {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 2vw, 24px);
  color: var(--text-secondary);
  margin-top: 10px;
}

/* ── PROJECT BODY ── */
.project-content,
.prose {
  max-width: 720px;
}

.project-excerpt {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 24px);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

/* ── PORTABLE TEXT / PROSE ── */
.prose p,
.project-content p {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.prose h2,
.project-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 56px 0 20px;
}

.prose h3,
.project-content h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 40px 0 14px;
}

.prose blockquote,
.project-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 6px 0 6px 24px;
  margin: 36px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 26px);
  color: var(--text-primary);
  line-height: 1.5;
}

.pt-image,
.prose figure {
  margin: 48px 0;
}

.pt-image img,
.prose figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── BACK LINK ── */
.project-back {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.back-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.back-link:hover { color: var(--accent); }

/* ── POST HEADER ── */
.post-header { padding-bottom: 60px; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

h1.post-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 900px;
}

.post-excerpt {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 24px);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
  margin-top: 28px;
}

.post-body { padding-top: 60px; }

/* ── FOOTER ── */
footer {
  padding: 60px 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid var(--border);
}

.footer-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--accent); }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 16px 20px; }
  .nav-links { gap: 20px; }

  .hero { padding: 0 20px 40px; }
  .hero-scroll { display: none; }

  .page-hero { padding: 120px 20px 60px; }

  .section { padding: 80px 20px; }

  .work-grid { grid-template-columns: 1fr; }
  .disciplines { flex-direction: column; }
  .about-split { grid-template-columns: 1fr; gap: 40px; }

  .project-hero { height: 50vh; padding: 32px 20px; }
  .post-header { padding-left: 20px; padding-right: 20px; }

  footer { flex-direction: column; gap: 24px; align-items: flex-start; }
}
