/* --------------------------------------------------------
   James Carroll — personal site
   Aesthetic: data-inspired color, generous whitespace, scroll-reveal.
   Minimal: a name, a catch line, one subtle interests sentence,
   a quiet question, the links.
   -------------------------------------------------------- */

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

:root {
  --blue:   hsl(210, 65%, 55%);
  --teal:   hsl(175, 50%, 42%);
  --coral:  hsl(8, 70%, 62%);
  --violet: hsl(260, 45%, 58%);
  --slate:  hsl(210, 10%, 30%);

  --bg:    #fafaf8;
  --fg:    #1a1a1a;
  --muted: #777;
  --faint: #e4e4e0;
  --link:  var(--teal);
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

/* --- Dot grid canvas (drawn by scroll.js) --- */
.dots-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}

/* --- Container --- */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Scroll reveal --- */
[data-scroll] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-scroll].is-visible { opacity: 1; transform: translateY(0); }

/* --- Subtle inline link --- */
.lnk {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.lnk:hover, .lnk:focus-visible { border-color: var(--link); }

/* --- Hero --- */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 5vh;
}
.hero__name {
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.0;
}
.hero__given {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Pronouns + interrobang footnote link */
.hero__pronouns {
  display: inline-block;
  margin-left: 0.45rem;
  font-size: 0.24em;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  vertical-align: baseline;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.hero__pronouns:hover, .hero__pronouns:focus-visible { color: var(--violet); }
.hero__interrobang {
  font-size: 1.15em;
  font-weight: 700;
  vertical-align: super;
  margin-left: 0.05em;
  color: var(--violet);
}
.hero__pronouns:hover .hero__interrobang,
.hero__pronouns:focus-visible .hero__interrobang { text-decoration: underline; }

/* --- About: catch line + interests sentence --- */
.about { padding: 3rem 0 4rem; }
.catch {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  max-width: 30ch;
}
.catch i { font-style: italic; color: var(--violet); }
.intro {
  font-size: 1rem;
  color: var(--slate);
  margin-top: 1.4rem;
  max-width: 54ch;
  line-height: 1.7;
}

/* --- Footer question --- */
.ask { padding: 3.5rem 0 1.2rem; }
.ask__q { font-size: 1rem; color: var(--slate); font-weight: 500; }
.ask__q i { color: var(--coral); font-style: italic; }

/* --- Contact / footer --- */
.contact { padding: 1rem 0 7rem; }
.contact__links { display: flex; gap: 2.2rem; flex-wrap: wrap; }
.contact__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--slate);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.contact__link:hover { color: var(--blue); }
.icon { width: 19px; height: 19px; }

/* --- Selection color --- */
::selection { background: var(--blue); color: #fff; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  [data-scroll] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* --- Dark mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:    #0e0e0d;
    --fg:    #e8e8e4;
    --muted: #8a8a86;
    --faint: #252523;
    --slate: #c0c0bb;

    --blue:   hsl(210, 60%, 62%);
    --teal:   hsl(175, 45%, 52%);
    --coral:  hsl(8, 65%, 66%);
    --violet: hsl(260, 40%, 68%);
  }
  body { background: var(--bg); color: var(--fg); }
  .dots-canvas { opacity: 0.3; }
  ::selection { background: var(--teal); color: #0e0e0d; }
}
