/* ============ Base ============ */
:root {
  --bg: #09090c;
  --ink: #f2f2f4;
  --muted: rgba(242, 242, 244, 0.55);
  --faint: rgba(242, 242, 244, 0.28);
  --accent: #818cf8;
  --accent-soft: rgba(129, 140, 248, 0.55);
  --hairline: rgba(242, 242, 244, 0.14);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

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

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

/* ============ Ambient background ============ */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.orb-gold {
  width: 55vmax; height: 55vmax;
  top: -20vmax; right: -12vmax;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 0%, transparent 65%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.orb-blue {
  width: 60vmax; height: 60vmax;
  bottom: -25vmax; left: -18vmax;
  background: radial-gradient(circle, rgba(165, 165, 180, 0.08) 0%, transparent 65%);
  animation: drift-b 32s ease-in-out infinite alternate;
}

.orb-amber {
  width: 34vmax; height: 34vmax;
  top: 55%; left: 55%;
  background: radial-gradient(circle, rgba(200, 200, 220, 0.05) 0%, transparent 65%);
  animation: drift-c 40s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-8vmax, 10vmax) scale(1.15); }
}
@keyframes drift-b {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(10vmax, -8vmax) scale(1.1); }
}
@keyframes drift-c {
  from { transform: translate(0, 0); }
  to   { transform: translate(-12vmax, -10vmax); }
}

.grain {
  position: absolute;
  inset: -50%;
  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)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain-shift 0.9s steps(3) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 480px; height: 480px;
  margin: -240px 0 0 -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}

body.has-cursor .cursor-glow { opacity: 1; }

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: clamp(24px, 5vw, 64px);
}

.hero-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 8vh, 96px);
}

/* Signature — the main element, centered */
.signature-wrap {
  position: relative;
  align-self: center;
  width: min(560px, 78vw);
  margin-top: clamp(8px, 4vh, 40px);
}

.signature {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 24px rgba(255, 255, 255, 0.14));
  -webkit-mask-image: linear-gradient(105deg, #000 0%, #000 40%, transparent 60%, transparent 100%);
  mask-image: linear-gradient(105deg, #000 0%, #000 40%, transparent 60%, transparent 100%);
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: sig-write 2.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards,
             sig-float 7s ease-in-out 2.6s infinite alternate;
}

@keyframes sig-write {
  to {
    -webkit-mask-position: 0% 0;
    mask-position: 0% 0;
  }
}

@keyframes sig-float {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(-8px) rotate(-0.5deg); }
}

.signature-glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.07) 0%, transparent 60%);
  z-index: -1;
  animation: glow-pulse 5s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

/* Hero copy — centered below the signature */
.hero-copy {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-copy .sub {
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6.2vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.headline em {
  font-style: italic;
  color: var(--accent);
}

.headline .line {
  display: block;
  overflow: hidden;
}

.headline .line > span {
  display: block;
  transform: translateY(110%);
  animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.headline .line:nth-child(1) > span { animation-delay: 0.55s; }
.headline .line:nth-child(2) > span { animation-delay: 0.7s; }

.reveal-line { overflow: hidden; }

.reveal-line > span {
  display: inline-block;
  transform: translateY(120%);
  animation: rise 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.eyebrow.reveal-line > span { animation-delay: 0.45s; }
.sub.reveal-line > span { animation-delay: 0.9s; }
.hero-cta.reveal-line > span { animation-delay: 1.05s; }

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

.sub {
  margin-top: 24px;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted);
  max-width: 46ch;
}

.hero-cta {
  display: inline-block;
  margin-top: 36px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.hero-cta > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.hero-cta:hover > span {
  border-color: var(--accent-soft);
  background: rgba(129, 140, 248, 0.08);
  transform: translateY(-2px);
}

.hero-cta svg { transition: transform 0.3s ease; }
.hero-cta:hover svg { transform: translateY(3px); }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 56px;
  background: var(--hairline);
  overflow: hidden;
}

.scroll-cue span {
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--accent);
  animation: cue-drop 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes cue-drop {
  0% { top: -40%; }
  100% { top: 110%; }
}

/* ============ Sections ============ */
main { position: relative; z-index: 1; }

section {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(72px, 12vh, 140px) clamp(24px, 5vw, 64px);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.1;
  margin-bottom: clamp(36px, 6vh, 64px);
}

.section-title em {
  font-style: italic;
  color: var(--accent);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ============ Contact list ============ */
.contact-list {
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.contact-list li {
  position: relative;
  border-bottom: 1px solid var(--hairline);
}

.contact-list li:nth-child(2).reveal { transition-delay: 0.08s; }
.contact-list li:nth-child(3).reveal { transition-delay: 0.16s; }

.contact-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr auto;
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  padding: clamp(24px, 4vh, 40px) clamp(4px, 1vw, 16px);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: padding-left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-row::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-row:hover::before { transform: scaleX(1); }
.contact-row:hover { padding-left: clamp(12px, 2vw, 28px); }

.contact-kind {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 0.3s ease;
}

.contact-row:hover .contact-kind { color: var(--accent); }

.contact-value {
  font-family: var(--serif);
  font-size: clamp(22px, 3.4vw, 42px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.contact-arrow {
  color: var(--faint);
  transition: color 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-row:hover .contact-arrow {
  color: var(--accent);
  transform: translateX(6px);
}

.copy-btn {
  position: absolute;
  right: clamp(48px, 6vw, 80px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.contact-list li:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

/* ============ Experience ============ */
.exp-list {
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.exp-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(22px, 3.5vh, 34px) clamp(4px, 1vw, 16px);
  border-bottom: 1px solid var(--hairline);
  transition: background 0.35s ease;
}

.exp-row:hover { background: rgba(242, 242, 244, 0.03); }

.exp-list .exp-row:nth-child(2).reveal { transition-delay: 0.07s; }
.exp-list .exp-row:nth-child(3).reveal { transition-delay: 0.14s; }
.exp-list .exp-row:nth-child(4).reveal { transition-delay: 0.21s; }

.exp-logo {
  display: flex;
  align-items: center;
}

.exp-logo img {
  max-height: 34px;
  max-width: 140px;
  width: auto;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.exp-row:hover .exp-logo img { opacity: 1; }

.exp-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exp-company {
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.2;
}

.exp-role {
  font-size: 14px;
  color: var(--muted);
}

.exp-years {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

/* ============ Writing ============ */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 24px);
}

.writing-logo {
  height: 30px;
  width: auto;
  max-width: 100%;
  align-self: flex-start;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  margin-bottom: 6px;
}

.writing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(28px, 4vw, 44px) clamp(22px, 3vw, 36px);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(242, 242, 244, 0.02);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}

.writing-card:nth-child(2).reveal { transition-delay: 0.08s; }
.writing-card:nth-child(3).reveal { transition-delay: 0.16s; }
.writing-card:nth-child(4).reveal { transition-delay: 0.24s; }

.writing-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-soft);
  background: rgba(129, 140, 248, 0.06);
  box-shadow: 0 18px 44px -18px rgba(129, 140, 248, 0.25);
}

.writing-pub {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 32px);
}

.writing-note {
  font-size: 14px;
  color: var(--muted);
}

.writing-arrow {
  position: absolute;
  top: 22px;
  right: 24px;
  font-size: 18px;
  color: var(--faint);
  transition: color 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.writing-card:hover .writing-arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* ============ Footer ============ */
.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 80px) clamp(24px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--hairline);
}

.footer-sig {
  width: 120px;
  height: auto;
  opacity: 0.55;
}

.footer p {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: var(--accent);
  color: #12142e;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 12px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
  z-index: 10;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ============ Responsive ============ */
@media (max-width: 720px) {
  .signature-wrap { width: min(420px, 86vw); }

  .contact-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "kind arrow" "value arrow";
    row-gap: 6px;
  }

  .contact-kind { grid-area: kind; }
  .contact-value { grid-area: value; }
  .contact-arrow { grid-area: arrow; }

  .copy-btn { display: none; }

  .writing-grid { grid-template-columns: 1fr; }

  .exp-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "logo years" "info info";
    row-gap: 14px;
  }

  .exp-logo { grid-area: logo; }
  .exp-info { grid-area: info; }
  .exp-years { grid-area: years; }

  .scroll-cue { display: none; }
}

@media (min-width: 721px) and (max-width: 1080px) {
  .writing-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .orb, .grain, .scroll-cue span, .signature, .signature-glow { animation: none !important; }

  .signature {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .headline .line > span,
  .reveal-line > span {
    transform: none;
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cursor-glow { display: none; }
}

/* ============ Mono at rest — indigo on interaction ============ */
/* Accent-colored text rests in ink/neutral; hovering its region blooms the indigo. */

.eyebrow {
  color: var(--muted);
  transition: color 0.45s ease;
}

.headline em,
.section-title em {
  color: inherit;
  transition: color 0.45s ease;
}

.hero-copy:hover .eyebrow,
.hero-copy:hover .headline em,
.section-title:hover em {
  color: var(--accent);
}

.hero-cta:hover > span { color: var(--accent); }

.signature { transition: filter 0.6s ease; }

.signature-wrap:hover .signature {
  filter: drop-shadow(0 0 28px rgba(129, 140, 248, 0.30));
}

.signature-glow { transition: background 0.6s ease; }

.signature-wrap:hover .signature-glow {
  background: radial-gradient(ellipse at center, rgba(129, 140, 248, 0.13) 0%, transparent 60%);
}

.scroll-cue span { background: rgba(242, 242, 244, 0.5); }

.exp-years { transition: color 0.35s ease; }
.exp-row:hover .exp-years { color: var(--accent); }

/* ============ Contact form ============ */
.contact-form {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 0.35s ease;
}

.field:focus-within .field-label { color: var(--accent); }

.field input,
.field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 10px 2px 14px;
  font-family: var(--serif);
  font-size: clamp(19px, 2vw, 24px);
  color: var(--ink);
  outline: none;
  resize: vertical;
  border-radius: 0;
  transition: border-color 0.35s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
  opacity: 0.7;
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--accent);
}

.form-submit {
  align-self: flex-start;
  margin-top: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
}

.form-submit > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.form-submit:hover > span {
  border-color: var(--accent-soft);
  background: rgba(129, 140, 248, 0.08);
  color: var(--accent);
  transform: translateY(-2px);
}

.form-submit svg { transition: transform 0.3s ease; }
.form-submit:hover svg { transform: translateX(4px); }

@media (max-width: 720px) {
  .field-row { grid-template-columns: 1fr; }
}
