/* ============================================================
   Laresprime — dark, editorial, AI-lab
   ============================================================ */

:root {
  --bg: #07070c;
  --bg-2: #0c0c14;
  --ink: #eceaf2;
  --muted: #9895a8;
  --faint: #5d5a6e;
  --line: rgba(236, 234, 242, 0.12);
  --line-soft: rgba(236, 234, 242, 0.05);
  --accent: #8b7bff;
  --accent-2: #59e3ff;
  --grad: linear-gradient(96deg, var(--accent) 0%, var(--accent-2) 100%);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --e: cubic-bezier(0.22, 1, 0.36, 1);
  --container: min(1200px, 92vw);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

.container { width: var(--container); margin: 0 auto; }

/* ---------- atmosphere ---------- */

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(4) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.5%, 1%); }
  50% { transform: translate(1%, -1.5%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(1.5%, 1%); }
}

.hairlines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  padding: 0 max(calc((100vw - var(--container)) / 2), 0px);
}

.hairlines span { width: 1px; height: 100%; background: var(--line-soft); }

main, header.nav, footer { position: relative; z-index: 1; }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 7, 12, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--e), background 0.4s var(--e);
}

.nav.scrolled { border-bottom-color: var(--line); background: rgba(7, 7, 12, 0.78); }

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px 1px rgba(139, 123, 255, 0.7);
}

.nav-links { display: flex; gap: 2.2rem; }

.nav-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding: 0.35em 0;
  transition: color 0.3s var(--e);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--e);
}

.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1em 1.8em;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.35s var(--e), box-shadow 0.35s var(--e),
              transform 0.35s var(--e), background 0.35s var(--e), color 0.35s var(--e);
}

.btn:hover {
  border-color: rgba(139, 123, 255, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -8px rgba(139, 123, 255, 0.45);
}

.btn-primary {
  background: var(--grad);
  border: 1px solid transparent;
  color: #0a0a10;
  font-weight: 500;
}

.btn-primary:hover {
  box-shadow: 0 10px 36px -8px rgba(139, 123, 255, 0.65);
  border-color: transparent;
}

.btn-small { padding: 0.7em 1.3em; font-size: 0.68rem; }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 0 0;
  background:
    radial-gradient(900px 480px at 78% -10%, rgba(139, 123, 255, 0.14), transparent 65%),
    radial-gradient(700px 420px at 8% 8%, rgba(89, 227, 255, 0.07), transparent 60%);
}

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9em;
  margin-bottom: 2.2rem;
}

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

.status { display: inline-flex; align-items: center; gap: 0.7em; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(89, 227, 255, 0.5);
  animation: pulse 2.4s var(--e) infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(89, 227, 255, 0.45); }
  70% { box-shadow: 0 0 0 11px rgba(89, 227, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(89, 227, 255, 0); }
}

.display {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 340;
  font-size: clamp(2.9rem, 7.6vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  max-width: 16ch;
}

.display em {
  font-style: italic;
  font-weight: 380;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin-top: 2.2rem;
  max-width: 44ch;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.65;
  color: var(--muted);
}

.cta-row {
  margin-top: 2.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.scope {
  margin-top: clamp(3rem, 7vh, 5.5rem);
  width: 100%;
  height: 130px;
  display: block;
}

.scope-cap {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- ticker ---------- */

.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg-2);
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  width: max-content;
  padding: 0.85rem 0;
  animation: slide 32s linear infinite;
}

.ticker-track span {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.ticker-track i {
  font-style: normal;
  color: var(--accent);
  font-size: 0.7rem;
}

@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

.section { padding: clamp(5rem, 11vh, 8.5rem) 0; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.sec-head .idx {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.sec-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  letter-spacing: -0.015em;
}

.statement {
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
  max-width: 24ch;
}

.statement em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- about ---------- */

.about-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  max-width: 62rem;
}

.about-grid p { color: var(--muted); font-size: 1.02rem; line-height: 1.75; }

.stats {
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2.5rem, 6vw, 5rem);
  list-style: none;
}

.stats li { display: flex; flex-direction: column; gap: 0.35rem; }

.stat-n {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 340;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-l {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- work ---------- */

.projects { list-style: none; }

.proj-row {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 2.7rem 1rem;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.projects li:last-child .proj-row { border-bottom: 1px solid var(--line); }

.proj-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(139, 123, 255, 0.09), rgba(89, 227, 255, 0.04) 45%, transparent 75%);
  opacity: 0;
  transition: opacity 0.5s var(--e);
}

.proj-row:hover::before { opacity: 1; }

.p-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  transition: color 0.4s var(--e);
}

.proj-row:hover .p-num { color: var(--accent-2); }

.p-main { display: flex; flex-direction: column; gap: 0.7rem; position: relative; }

.p-main h3 {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  transition: transform 0.5s var(--e);
}

.p-main p {
  color: var(--muted);
  max-width: 52ch;
  font-size: 0.98rem;
  line-height: 1.65;
}

.proj-row:hover .p-main h3 { transform: translateX(8px); }

.p-main h3::after {
  content: "";
  display: block;
  margin-top: 0.45rem;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--e);
}

.proj-row:hover .p-main h3::after { transform: scaleX(1); }

.p-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  position: relative;
}

.p-year {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--faint);
}

.p-tags { display: flex; gap: 0.5rem; }

.p-tags i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4em 0.95em;
}

.p-arrow {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.45s var(--e), color 0.45s var(--e);
}

.proj-row:hover .p-arrow {
  transform: translate(5px, -5px);
  color: var(--accent-2);
}

.work-foot {
  margin-top: 2.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}

/* ---------- capabilities ---------- */

.cap-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3.5rem;
}

.cap-grid li {
  border-top: 1px solid var(--line);
  padding: 1.7rem 0;
  transition: border-color 0.4s var(--e);
}

.cap-grid li:hover { border-top-color: rgba(139, 123, 255, 0.5); }

.cap-l {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.cap-grid li:hover .cap-l { color: var(--accent-2); }

.cap-grid p { color: var(--muted); font-size: 0.95rem; line-height: 1.65; max-width: 34ch; }

/* ---------- contact ---------- */

.contact { padding-bottom: clamp(4rem, 9vh, 7rem); }

.mail {
  display: inline-block;
  position: relative;
  margin-top: 2.6rem;
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(1.7rem, 4.6vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--e);
}

.mail:hover::after { transform: scaleX(1); }

.links {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2.4rem;
}

.links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s var(--e);
}

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

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); padding: 1.8rem 0 2.4rem; background: var(--bg-2); }

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 2rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(7px);
  transition:
    opacity 0.9s var(--e),
    transform 0.9s var(--e),
    filter 0.9s var(--e);
  transition-delay: var(--d, 0ms);
}

.reveal.in { opacity: 1; transform: none; filter: none; }

.projects .proj:nth-child(2) .reveal { --d: 90ms; }
.projects .proj:nth-child(3) .reveal { --d: 180ms; }
.cap-grid li:nth-child(2n) .reveal, .cap-grid li:nth-child(even) { --d: 110ms; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .nav-links { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .cap-grid { grid-template-columns: 1fr; gap: 0; }
  .proj-row { grid-template-columns: 1fr; gap: 0.9rem; padding: 2.1rem 0.5rem; }
  .p-meta {
    flex-direction: row;
    align-items: center;
    align-self: flex-start;
    flex-wrap: wrap;
    gap: 0.9rem;
  }
  .p-arrow { display: none; }
  .display { max-width: 100%; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .ticker-track, .dot { animation: none; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .proj-row:hover .p-main h3 { transform: none; }
  .btn:hover { transform: none; }
}
