/*
 * Prepended to one-pager.css when generating styles.css (static index.html).
 * Keep in sync with h1–h3 rules in globals.css @layer base.
 */

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 700;
}

h1 {
  margin-top: var(--space-3);
  font-size: clamp(2rem, 4.8vw, 4rem);
  max-width: 14ch;
}

.hero h1 {
  max-width: min(42ch, 100%);
}

h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.25rem);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
}
:root {
  --white: #ffffff;
  --grey: #d7d7d7;
  --ink: #0e0e0e;
  --charcoal: #1a1a1a;
  --peach: #f2b8ab;
  --soft-black: #232323;

  --font-heading: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial,
    sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial,
    sans-serif;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 6rem;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.parallax-layer {
  position: absolute;
  inset: -10% -15%;
  background-repeat: no-repeat;
  opacity: 0.3;
  will-change: transform;
}

.layer-a {
  background-image: radial-gradient(circle at 20% 25%, #dedede 0%, transparent 45%),
    radial-gradient(circle at 70% 15%, #f5d8d2 0%, transparent 35%);
}

.layer-b {
  background-image: linear-gradient(110deg, transparent 20%, #ededed 45%, transparent 70%);
}

.layer-c {
  background-image: radial-gradient(circle at 70% 65%, #dcdcdc 0%, transparent 40%),
    radial-gradient(circle at 25% 80%, #f1d6cf 0%, transparent 35%);
}

.layout {
  width: 100%;
  margin: 0;
  padding: 0;
}

.snap-section {
  position: sticky;
  top: 0;
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  border-top: none;
  isolation: isolate;
}

.layout > .snap-section:nth-child(1) {
  z-index: 1;
}

.layout > .snap-section:nth-child(2) {
  z-index: 2;
}

.layout > .snap-section:nth-child(3) {
  z-index: 3;
}

.layout > .snap-section:nth-child(4) {
  z-index: 4;
}

.layout > .snap-section:nth-child(5) {
  z-index: 5;
}

.layout > .snap-section:nth-child(6) {
  z-index: 6;
}

.section {
  padding: var(--space-7) 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.section.snap-section {
  padding: clamp(2rem, 5vh, 3.5rem) 0;
  border-top: none;
}

.section-inner {
  width: min(1080px, calc(100vw - 3rem));
  margin: 0 auto;
}

.section:first-child {
  border-top: 0;
}

.eyebrow {
  margin: 0;
  color: var(--soft-black);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
}

.intro-text {
  display: grid;
  gap: 0.25rem;
}

.title-tag {
  margin: 0;
  color: var(--peach);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

a.project-title-link {
  color: var(--peach);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 184, 171, 0.5);
  border-bottom: 1px solid color-mix(in srgb, var(--peach) 55%, transparent);
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

a.project-title-link:hover {
  color: #f4d03f;
  border-bottom-color: rgba(244, 208, 63, 0.55);
}

/* h1–h3: see globals.css @layer base (must override Tailwind Preflight) */

p {
  margin: 0;
}

.intro-head {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

/* In-flow slot above hero headline; min-height set in JS when docked to avoid jump */
.hero-intro-slot {
  margin-bottom: var(--space-3);
}

/* Above .layout snap sections (z-index 1–6 + isolation); must not live inside hero stacking context */
.intro-head.intro-head-docked {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 5000;
  width: min(1080px, calc(100vw - 3rem));
  margin: 0 auto;
  pointer-events: none;
}

.intro-head.intro-head-docked .profile-photo,
.intro-head.intro-head-docked .intro-text {
  pointer-events: auto;
}

.hero .section-inner {
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
}

.profile-photo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 100%;
  border: 2px solid var(--peach);
}

.lead {
  margin-top: var(--space-4);
  max-width: 66ch;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

.micro-proof {
  margin-top: var(--space-4);
  max-width: 68ch;
  color: #4d4d4d;
}

/* Only .hero: #domains uses dark pattern below — avoid `background` shorthand on #domains (resets layers). */
.hero {
  background: var(--white);
}

/*
 * Dark sections: #000 + visible soft light pools.
 * Previous stops (~0.04–0.12) read as “nothing” on real displays; these are stronger.
 */
#domains,
.closing {
  background-color: #000;
  background-image:
    radial-gradient(ellipse 130% 85% at 8% 12%, rgba(255, 255, 255, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 95% 100% at 92% 78%, rgba(255, 255, 255, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 75% 65% at 42% 52%, rgba(255, 255, 255, 0.18) 0%, transparent 52%),
    radial-gradient(ellipse 110% 55% at 78% 8%, rgba(255, 255, 255, 0.16) 0%, transparent 50%),
    radial-gradient(ellipse 60% 85% at 18% 92%, rgba(255, 255, 255, 0.14) 0%, transparent 52%),
    radial-gradient(ellipse 50% 45% at 62% 35%, rgba(255, 255, 255, 0.12) 0%, transparent 48%);
  background-repeat: no-repeat;
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%,
    100% 100%;
}

/* --------------------------------------------------------------------------
 * Grain / noise overlay (reusable)
 * - Add class "grain" on a position: relative container.
 * - Optional "grain--dark" for slightly stronger noise on #000 (tune --grain-opacity).
 * - ::before = full-bleed tile; does not affect layout; pointer-events: none.
 * -------------------------------------------------------------------------- */
.grain {
  position: relative;
  /* Tune with --grain-opacity / --grain-blend on the element */
  --grain-opacity: 0.14;
  --grain-blend: overlay;
}

.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  /* Tiled SVG noise: grayscale turbulence, no external assets */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/*
 * On pure #000, overlay dulls toward invisible. Screen “adds light” so grain reads.
 * If this feels strong, lower only --grain-opacity (e.g. 0.22).
 */
.grain--dark {
  --grain-opacity: 0.32;
  --grain-blend: screen;
}

/* Keep all direct children above the ::before grain (z-index: 0) */
.grain > * {
  position: relative;
  z-index: 1;
}

#domains {
  color: var(--white);
  margin: 0;
  border-top: 0;
  overflow: visible;
  position: relative;
}

#domains h2,
#domains h3 {
  color: var(--white);
}

#domains .domains-grid article {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#domains .domains-grid p {
  color: #d2d2d2;
}

@media (min-width: 981px) {
  #domains .domains-grid {
    gap: 0;
  }

  #domains .domains-grid article {
    padding: var(--space-5);
  }

  #domains .domains-grid article:nth-child(1) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  #domains .domains-grid article:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  #domains .domains-grid article:nth-child(3) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
}

#problems {
  margin: 0;
  background-color: #ebebeb;
  background-image:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.62) 0%,
      rgba(241, 241, 241, 0.52) 50%,
      rgba(235, 235, 235, 0.65) 100%
    ),
    url("/Images/1.png");
  background-size: cover, cover;
  background-position: center, left center;
  background-repeat: no-repeat;
}

#working-on {
  margin: 0;
  background-color: #ebebeb;
  background-image:
    linear-gradient(
      175deg,
      rgba(255, 255, 255, 0.62) 0%,
      rgba(241, 241, 241, 0.52) 50%,
      rgba(235, 235, 235, 0.65) 100%
    ),
    url("/Images/2.png");
  background-size: cover, cover;
  background-position: center, center center;
  background-repeat: no-repeat;
}

#experience {
  margin: 0;
  background-color: #ebebeb;
  background-image:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.62) 0%,
      rgba(241, 241, 241, 0.52) 48%,
      rgba(235, 235, 235, 0.65) 100%
    ),
    url("/Images/3.png");
  background-size: cover, cover;
  background-position: center, right center;
  background-repeat: no-repeat;
}

.hero {
  border-top: 0;
}

.hero.snap-section {
  justify-content: center;
}

.grid-two {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: var(--space-5);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 14px;
}

.card p {
  margin-top: var(--space-3);
  color: #4c4c4c;
}

.themes {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme h3 {
  margin-bottom: var(--space-3);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  position: relative;
  margin-bottom: var(--space-2);
  padding-left: 1.1rem;
  color: #383838;
}

li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 100%;
  background: var(--soft-black);
}

.stack {
  display: grid;
  gap: var(--space-4);
}

.row {
  display: grid;
  gap: var(--space-2);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.row-head h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.project-status {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  padding: 0.35em 0.85em;
  border-radius: 999px;
  background: var(--peach);
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(0.68rem, 1.15vw, 0.78rem);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  line-height: 1.2;
  white-space: nowrap;
}

.row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.row p {
  color: #4a4a4a;
  max-width: 68ch;
}

.experience-list {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 1.9vw, 1.85rem);
  line-height: 1.35;
}

.closing p {
  font-size: clamp(1.2rem, 1.85vw, 1.75rem);
  max-width: 42ch;
}

.closing {
  color: var(--white);
  border-top: 0;
  margin-top: 0;
  overflow: visible;
  position: relative;
}

.closing.snap-section {
  justify-content: space-between;
  padding: var(--space-6);
  padding-bottom: 0;
}

.closing:not(.snap-section) {
  padding: var(--space-6);
}

.closing-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-top: var(--space-3);
}

.closing.snap-section .closing-inner {
  flex: 1;
  align-content: center;
  min-height: 0;
}

.closing.snap-section .site-footer {
  flex-shrink: 0;
  margin-top: auto;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--peach);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 0.8rem 1.3rem;
  border: 1px solid transparent;
  transition: transform 220ms ease, filter 220ms ease;
}

button.contact-button {
  cursor: pointer;
  font: inherit;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.closing-contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.contact-form {
  width: min(720px, 100%);
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
}

/* Wins over display:grid above when form is closed (e.g. NoteSynth until “Contact Me”). */
.contact-form[hidden] {
  display: none !important;
}

.contact-form-intro {
  color: #f1f1f1;
}

.contact-form-field {
  display: grid;
  gap: 0.4rem;
  color: var(--white);
  font-weight: 500;
}

.contact-form-field span {
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  padding: 0.72rem 0.86rem;
  font: inherit;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 2px solid var(--peach);
  outline-offset: 2px;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form-honeypot {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

.contact-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.contact-form .contact-button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.contact-form-feedback {
  font-size: 0.95rem;
  line-height: 1.4;
}

.contact-form-feedback--success {
  color: #d7f3dd;
}

.contact-form-feedback--error {
  color: #ffd4d4;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: transform 220ms ease, background 220ms ease, border-color 220ms ease;
}

.contact-link:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.04);
}

.contact-link:focus-visible {
  outline: 2px solid var(--peach);
  outline-offset: 3px;
}

.contact-link--on-dark {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

.contact-link--on-dark:hover {
  background: rgba(255, 255, 255, 0.08);
}

.contact-link--on-dark:focus-visible {
  outline-color: var(--peach);
}

.contact-button:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.contact-button:focus-visible {
  outline: 2px solid var(--peach);
  outline-offset: 3px;
}

.site-footer {
  width: 100%;
  height: 84px;
  background: transparent;
}

.js-enabled .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 600ms ease, transform 700ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.js-enabled .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero copy is always in the first viewport; keep visible if IO misses on first paint (static script + snap layouts). */
.js-enabled .hero .hero-body.reveal {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .grid-two,
  .themes {
    grid-template-columns: 1fr;
  }

  .layout {
    width: 100%;
  }

  .section-inner {
    width: min(1080px, calc(100vw - 2rem));
  }

  .section.snap-section {
    padding: var(--space-5) 0;
  }

  .closing.snap-section {
    padding: var(--space-5);
    padding-bottom: 0;
  }

  #domains .domains-grid article {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }

  #domains .domains-grid article:last-child {
    border-bottom: none;
  }
}

@media (max-width: 520px) {
  .row-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-status {
    margin-left: 0;
    align-self: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: none;
  }

  .parallax-layer {
    transform: none !important;
  }

  .js-enabled .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
