/* Ryan Durrant — ryandurrant.com
   Clean modern theme: cool slate, teal accent */

:root {
  color-scheme: light;
  --bg: #eef2f6;
  --bg-elevated: #ffffff;
  --bg-soft: #f7f9fb;
  --ink: #0b1220;
  --ink-muted: #5b677a;
  --line: #d7dee8;
  --accent: #0f766e;
  --accent-deep: #115e59;
  --accent-bright: #14b8a6;
  --accent-hover: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --btn-on-accent: #f0fdfa;
  --glass: #ffffff;
  --glow: rgba(20, 184, 166, 0.14);
  --glow-mid: rgba(15, 118, 110, 0.08);
  --glow-strong: rgba(20, 184, 166, 0.22);
  --hero-wash-0: rgba(238, 242, 246, 0.92);
  --hero-wash-1: rgba(238, 242, 246, 0.72);
  --hero-wash-2: rgba(238, 242, 246, 0.35);
  --stripe: rgba(15, 118, 110, 0.035);
  --page-top: #f5f8fb;
  --page-bottom: #e8eef4;
  --shadow: 0 1px 0 rgba(11, 18, 32, 0.04);
  --shadow-cover:
    0 20px 48px rgba(11, 18, 32, 0.16),
    0 4px 12px rgba(11, 18, 32, 0.08);
  --shadow-nav: 0 12px 32px rgba(11, 18, 32, 0.08);
  --radius: 10px;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Syne", system-ui, sans-serif;
  --space: clamp(1rem, 3vw, 1.5rem);
  --wrap: min(1100px, calc(100% - 2 * var(--space)));
  --header-h: 4rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0c1219;
    --bg-elevated: #151c26;
    --bg-soft: #111820;
    --ink: #e8eef6;
    --ink-muted: #9aa8bb;
    --line: #2a3544;
    --accent: #2dd4bf;
    --accent-deep: #5eead4;
    --accent-bright: #5eead4;
    --accent-hover: #14b8a6;
    --accent-soft: rgba(45, 212, 191, 0.14);
    --btn-on-accent: #042f2e;
    --glass: #e8eef6;
    --glow: rgba(45, 212, 191, 0.16);
    --glow-mid: rgba(20, 184, 166, 0.1);
    --glow-strong: rgba(45, 212, 191, 0.22);
    --hero-wash-0: rgba(12, 18, 25, 0.92);
    --hero-wash-1: rgba(12, 18, 25, 0.78);
    --hero-wash-2: rgba(12, 18, 25, 0.4);
    --stripe: rgba(45, 212, 191, 0.06);
    --page-top: #101820;
    --page-bottom: #0a1016;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
    --shadow-cover:
      0 20px 48px rgba(0, 0, 0, 0.45),
      0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-nav: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 55% at 85% -5%, var(--glow), transparent 55%),
    radial-gradient(ellipse 70% 45% at -5% 15%, var(--glow-mid), transparent 50%),
    linear-gradient(180deg, var(--page-top) 0%, var(--bg) 40%, var(--page-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-deep);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--space);
  top: -100px;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.wrap.narrow {
  max-width: 40rem;
  width: min(40rem, calc(100% - 2 * var(--space)));
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.logo:hover {
  color: var(--accent-deep);
}

.site-nav ul {
  display: flex;
  gap: 0.25rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Hero — full-bleed composition */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(4rem, 10vw, 6rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, var(--hero-wash-0) 0%, var(--hero-wash-1) 42%, var(--hero-wash-2) 100%),
    radial-gradient(ellipse 60% 80% at 78% 45%, var(--glow-strong), transparent 60%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 48px,
      var(--stripe) 48px,
      var(--stripe) 49px
    );
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
  }
}

.brand-mark {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.75rem, 8vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: var(--ink);
  animation: rise-in 0.8s var(--ease) both;
}

.hero h1 {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
  animation: rise-in 0.8s var(--ease) 0.08s both;
}

.lede {
  margin: 0 0 1.75rem;
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 34rem;
  animation: rise-in 0.8s var(--ease) 0.16s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  animation: rise-in 0.8s var(--ease) 0.24s both;
}

.hero-visual {
  display: grid;
  place-items: center;
  animation: fade-scale 1s var(--ease) 0.2s both;
}

.hero-portrait {
  width: min(320px, 78vw);
  height: auto;
  display: block;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-cover);
  border: 1px solid var(--line);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-scale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--btn-on-accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--btn-on-accent);
}

.btn-ghost {
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
  background: var(--bg-elevated);
}

.btn-lg {
  padding: 0.9rem 1.5rem;
  font-size: 1.05rem;
}

/* Sections */
.section {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.section-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-intro {
  margin: -0.25rem 0 2rem;
  color: var(--ink-muted);
  max-width: 36rem;
}

.prose p {
  margin: 0 0 1.1rem;
  color: var(--ink-muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

.about {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 55%, transparent);
}

/* Work / project rows — clean list, not card deck */
.row-list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  gap: 0.5rem 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease;
}

@media (min-width: 720px) {
  .row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
    align-items: start;
    gap: 1.25rem 2rem;
  }

  .row--app {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  }
}

.row:hover {
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
}

.row h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.row p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.row-meta {
  font-size: 0.78rem !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep) !important;
  white-space: nowrap;
}

@media (min-width: 720px) {
  .row-meta {
    text-align: right;
    padding-top: 0.2rem;
  }
}

.row--app .app-icon,
.row--app .app-icon--feature {
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  object-fit: cover;
}

@media (min-width: 720px) {
  .row--app {
    grid-template-columns: 140px minmax(0, 1fr) auto;
  }

  .row--app .app-icon,
  .row--app .app-icon--feature {
    max-width: 140px;
    margin-bottom: 0;
    grid-row: 1 / span 2;
  }

  .row--app h3 {
    grid-column: 2;
  }

  .row--app > p:not(.row-meta) {
    grid-column: 2;
  }

  .row--app .row-meta {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

/* Book */
.book {
  background:
    radial-gradient(ellipse 50% 60% at 90% 50%, var(--glow), transparent 65%),
    var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.book-panel {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 800px) {
  .book-panel {
    grid-template-columns: 1.35fr 0.65fr;
    gap: 3rem;
  }
}

.book-subtitle {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-muted);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.book-copy > p:not(.section-label):not(.book-subtitle):not(.fine-print) {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
  max-width: 34rem;
}

.fine-print {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.book-cover {
  display: flex;
  justify-content: center;
}

.cover-image {
  width: min(240px, 75%);
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-cover);
  display: block;
  transition: transform 0.4s var(--ease);
}

.book-panel:hover .cover-image {
  transform: translateY(-4px);
}

/* Contact */
.contact p {
  color: var(--ink-muted);
}

.contact a {
  font-weight: 600;
}

.social-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.social-list a {
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding-bottom: 0.1rem;
  transition: border-color 0.15s ease;
}

.social-list a:hover {
  border-bottom-color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0 2.25rem;
  background: var(--bg-elevated);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.footer-domain {
  font-weight: 600;
  color: var(--ink) !important;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* Mobile nav */
@media (max-width: 719px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
    padding: 1rem var(--space) 1.25rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
    box-shadow: var(--shadow-nav);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.15rem;
  }

  .site-nav a {
    display: block;
    padding: 0.65rem 0.25rem;
    font-size: 1.05rem;
  }
}

/* Visually hidden (a11y) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Horizontal path */
.horizontal-scroll-scroller {
  --horizontal-panels: 5;
  position: relative;
  height: calc(var(--horizontal-panels) * 100vh);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.horizontal-scroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 50% 40% at 50% 30%, var(--glow), transparent 70%),
    var(--bg-elevated);
}

.horizontal-section__track {
  display: flex;
  flex: 1;
  flex-direction: row;
  width: max-content;
  min-height: 0;
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.horizontal-panel {
  flex: 0 0 100vw;
  flex-shrink: 0;
  width: 100vw;
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 2rem) var(--space) 2.5rem;
}

.horizontal-panel__inner {
  max-width: 28rem;
  text-align: left;
}

.horizontal-panel__num {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.horizontal-panel__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.horizontal-panel__text {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.horizontal-section__hint {
  flex-shrink: 0;
  margin: 0;
  padding: 0 var(--space) 1.25rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 640px) {
  .horizontal-section__hint {
    display: none;
  }

  /* Stack path panels on small screens — horizontal sticky scroll is awkward on phones */
  .horizontal-scroll-scroller {
    height: auto;
  }

  .horizontal-scroll-sticky {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .horizontal-section__track {
    flex-direction: column;
    width: 100%;
    transform: none !important;
  }

  .horizontal-panel {
    width: 100%;
    flex-basis: auto;
    padding: 2.75rem var(--space);
    justify-content: flex-start;
  }

  .horizontal-panel__inner {
    max-width: none;
    width: 100%;
  }

  .horizontal-panel__title {
    font-size: clamp(1.85rem, 9vw, 2.5rem);
    overflow-wrap: normal;
    word-break: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .horizontal-scroll-scroller {
    height: auto;
  }

  .horizontal-scroll-sticky {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .horizontal-section__track {
    flex-direction: column;
    width: 100%;
    transform: none !important;
  }

  .horizontal-panel {
    width: 100%;
    flex-basis: auto;
    padding: 2.5rem var(--space);
  }

  .brand-mark,
  .hero h1,
  .lede,
  .hero-actions,
  .hero-visual {
    animation: none;
  }
}
