/* ============================================================
   Joshua Noel — personal site
   Soft pastel palette on a cutting-mat blue backdrop.
   Edit the design tokens below and everything follows.
   ============================================================ */

:root {
  --bg: #e6eef9;               /* light cutting-mat blue */
  --grid-fine: rgba(64, 104, 158, 0.09);    /* 1-unit lines */
  --grid-major: rgba(64, 104, 158, 0.16);   /* every 5 units */
  --grid-diag: rgba(64, 104, 158, 0.06);    /* 45deg guides */
  --bg-elevated: #ffffff;      /* card surface */
  --border: rgba(120, 110, 150, 0.18);
  --border-strong: rgba(255, 158, 125, 0.6);
  --text: #3a3350;             /* deep plum, readable */
  --text-muted: #6f6889;
  --text-faint: #9a94ad;

  --accent: #ff9e7d;           /* light coral */
  --accent-2: #89cff0;         /* baby blue */
  --accent-3: #c3a2e2;         /* amethyst mist */
  --accent-4: #77dddd;         /* minty splash */

  /* "What I work on" icon colors — pastel set */
  --icon-1: #ffb6c1;           /* cherry blossom */
  --icon-2: #89cff0;           /* baby blue */
  --icon-3: #d4e157;           /* pastel lime */
  --icon-4: #e6a8d7;           /* lilac frost */

  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino,
          Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a2b;             /* deep cutting-mat navy */
    --grid-fine: rgba(150, 185, 230, 0.07);
    --grid-major: rgba(150, 185, 230, 0.14);
    --grid-diag: rgba(150, 185, 230, 0.05);
    --bg-elevated: rgba(255, 255, 255, 0.055);
    --border: rgba(230, 224, 245, 0.14);
    --border-strong: rgba(255, 171, 144, 0.5);
    --text: #efeaf6;
    --text-muted: #c3bcd6;
    --text-faint: #948da8;

    --accent: #ffab90;         /* light coral (lifted for dark) */
    --accent-2: #89cff0;       /* baby blue */
    --accent-3: #c3a2e2;       /* amethyst */
    --accent-4: #77dddd;       /* mint */
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Cutting-mat texture on a FIXED layer: rasterizes once into its own
   compositor layer and is never repainted while scrolling. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transform: translateZ(0);
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(45deg,  var(--grid-diag) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(-45deg, var(--grid-diag) 0 1px, transparent 1px 96px),
    linear-gradient(to right,  var(--grid-major) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to right,  var(--grid-fine) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-fine) 1px, transparent 1px);
  background-size:
    auto, auto,
    120px 120px, 120px 120px,
    24px 24px, 24px 24px;
}

/* ---------- Sections & layout ---------- */

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

section {
  padding: clamp(2.25rem, 6vh, 3.5rem) 0;
}

/* ---------- Full-viewport scroll-snap panels ---------- */

.panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 5.5rem 0 2rem;
}

.panel-intro { gap: 1.75rem; }
.panel-intro .hero,
.panel-intro .focus {
  padding-top: 0;
  padding-bottom: 0;
}

.panel-intro .hero { padding-bottom: 5rem; }

.panel-contact { gap: 1.5rem; }

.scroll-cue {
  align-self: center;
  margin-top: 0.25rem;
  color: var(--text-faint);
  animation: cueBounce 1.8s ease-in-out infinite;
}

.scroll-cue svg { width: 26px; height: 26px; display: block; }

@keyframes cueBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* On short or narrow screens, fall back to normal scrolling. */
@media (max-width: 760px), (max-height: 640px) {
  html { scroll-snap-type: none; }
  .panel { min-height: auto; padding: 4.5rem 0 2rem; }
  .panel-intro .hero, .panel-intro .focus { padding: clamp(2.25rem, 6vh, 3.5rem) 0; }
}

.section-inner {
  max-width: 720px;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

section p {
  color: var(--text-muted);
  max-width: 58ch;
}

section p + p {
  margin-top: 1rem;
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero-eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
}

.hero-name {
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text);
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  color: var(--text-muted);
  margin-top: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Highlighted phrase */
.hl {
  font-family: var(--font);
  font-style: normal;
  font-weight: 600;
  font-size: 0.9em;
  color: #a8371a;
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  padding: 0.06em 0.45em;
  border-radius: 9px;
  white-space: nowrap;
}

.hero-body {
  margin-top: 1.5rem;
  max-width: 62ch;
  color: var(--text-muted);
}

.hero-body p { color: var(--text-muted); }
.hero-body p + p { margin-top: 0.9rem; }

/* ---------- Focus cards ---------- */

.focus .section-inner {
  max-width: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.75rem;
}

/* Collapse the landscape row on smaller screens */
@media (max-width: 760px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  padding: 1.4rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: transform 0.3s ease, border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #4a3a52;
  margin-bottom: 1.2rem;
}

/* "What I work on" — each card keeps its own accent color */
.card:nth-child(1) .card-icon { background: var(--icon-1); }
.card:nth-child(2) .card-icon { background: var(--icon-2); }
.card:nth-child(3) .card-icon { background: var(--icon-3); }
.card:nth-child(4) .card-icon { background: var(--icon-4); }

.card:nth-child(1):hover { border-color: var(--icon-1); box-shadow: 0 12px 30px rgba(255, 182, 193, 0.45); }
.card:nth-child(2):hover { border-color: var(--icon-2); box-shadow: 0 12px 30px rgba(137, 207, 240, 0.45); }
.card:nth-child(3):hover { border-color: var(--icon-3); box-shadow: 0 12px 30px rgba(212, 225, 87, 0.45); }
.card:nth-child(4):hover { border-color: var(--icon-4); box-shadow: 0 12px 30px rgba(230, 168, 215, 0.45); }

.card-icon svg {
  width: 20px;
  height: 20px;
}

.card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ---------- Contact ---------- */

.panel-contact .section-inner {
  max-width: 820px;
  margin-inline: auto;
  text-align: center;
}

.panel-contact .section-inner > p {
  margin-inline: auto;
}

/* Rectangular contact cards, each with its brand logo */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}

@media (max-width: 680px) {
  .contact-cards {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-inline: auto;
  }
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.contact-card:hover,
.contact-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 26px rgba(30, 50, 90, 0.1);
}

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

.contact-card-logo {
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-card-logo svg { width: 30px; height: 30px; display: block; }
.contact-card-logo.email    { color: var(--accent); }
.contact-card-logo.whatsapp { color: #25d366; }
.contact-card-logo.linkedin { color: #0a66c2; }

.contact-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-card-label {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.contact-card-value {
  color: var(--text-muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Entrance animations ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Stagger siblings slightly */
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .card, .contact-card { transition: none; }
  .scroll-cue { animation: none; }
}
