/* =====================================================================
   Ryan McLaughlin — Portfolio
   Hand-written, no framework. Dark theme, emerald accent.
   ===================================================================== */

:root {
  --bg: #0b0f14;
  --bg-alt: #0f151c;
  --surface: #131b24;
  --surface-2: #1a242f;
  --border: #243140;
  --text: #e7edf3;
  --text-dim: #9fb0c0;
  --text-mute: #6c7d8d;
  --accent: #34d399;
  --accent-2: #22d3ee;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --danger: #f87171;

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
strong { color: var(--text); font-weight: 600; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn--sm { padding: 0.6rem 1.1rem; font-size: 0.875rem; }
.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #042018;
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(52, 211, 153, 0.6);
}
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(11, 15, 20, 0.8);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}
.nav__brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #042018;
  font-size: 0.85rem;
  font-weight: 800;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav__links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav__links a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--accent); }
.nav__links a.is-active::after { width: 100%; }
.nav__cta {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
}
.nav__cta:hover { border-color: var(--accent); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 0 80px;
}
.hero__glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  max-width: 120vw;
  background: radial-gradient(
    circle,
    rgba(52, 211, 153, 0.16),
    rgba(34, 211, 238, 0.06) 40%,
    transparent 70%
  );
  filter: blur(20px);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 860px; }
.hero__avatar {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 0 0 4px var(--accent-soft);
  margin-bottom: 1.75rem;
}
.hero__eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}
.hero__title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  /* Reserve space for the tallest rotating line so swaps never reflow the page.
     The line is vertically centered, so shorter lines just sit in the reserve. */
  min-height: 3.6em;
  display: flex;
  align-items: center;
}
.hero__line {
  display: inline-block;
  will-change: opacity, transform;
}
.hero__lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 2.25rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}
.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.hero__chips li {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section--alt { background: var(--bg-alt); }
.section__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}
.section__num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
}
.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about__body p { color: var(--text-dim); margin-bottom: 1.25rem; }
.about__body p:last-child { margin-bottom: 0; }
.about__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: sticky;
  top: 100px;
}
.about__card-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-bottom: 1.25rem;
}
.about__facts > div {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.about__facts > div:first-child { border-top: 0; padding-top: 0; }
.about__facts dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  margin-bottom: 0.2rem;
}
.about__facts dd { font-weight: 600; }

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: var(--accent);
}
.skill-card li {
  color: var(--text-dim);
  font-size: 0.92rem;
  padding: 0.3rem 0 0.3rem 1.1rem;
  position: relative;
}
.skill-card li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Projects ---------- */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mute);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.badge--accent {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.project--flagship {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2.5rem;
  background: linear-gradient(160deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.project--flagship::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.project__title { font-size: 1.9rem; margin-bottom: 0.6rem; }
.project__tagline {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}
.project__desc { color: var(--text-dim); margin-bottom: 1.5rem; }
.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.project__tags li {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}
.project__links { display: flex; gap: 1rem; flex-wrap: wrap; }
.project__note {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--text-mute);
}
.project__highlights {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  align-self: center;
}
.project__highlights h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-bottom: 1rem;
}
.project__highlights li {
  display: flex;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 0.45rem 0;
}
.project__highlights li span { color: var(--accent); flex-shrink: 0; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.project-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.project-card h3 { font-size: 1.3rem; margin-bottom: 0.75rem; }
.project-card p { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 1.25rem; }
.link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}
.link:hover { border-bottom-color: var(--accent); }

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg-alt);
}
.timeline__item--muted::before { background: var(--text-mute); }
.timeline__when {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  padding-top: 2px;
}
.timeline__body h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.timeline__body h3 span { color: var(--text-mute); font-weight: 500; }
.timeline__body p { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- Contact ---------- */
.section--contact { padding-bottom: 120px; }
.contact__lede {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 2.5rem;
}
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.contact__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.4rem;
  font-weight: 500;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.contact__link:hover { transform: translateY(-3px); border-color: var(--accent); }
.contact__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--text-mute);
  font-size: 0.85rem;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about,
  .project--flagship { grid-template-columns: 1fr; }
  .about__card { position: static; }
  .project__highlights { order: -1; }
}

@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(11, 15, 20, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 24px 1.5rem;
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a {
    width: 100%;
    padding: 0.85rem 0;
    font-size: 1rem;
  }
  .nav__cta { margin-top: 0.5rem; }

  .timeline__item { grid-template-columns: 1fr; gap: 0.4rem; }
  .section { padding: 72px 0; }

  /* Lines wrap to more rows on narrow screens — reserve more so swaps don't shift. */
  .hero__title { min-height: 6.5em; }
}
