:root {
  color-scheme: light;
  --bg-core: #f1efe5;
  --bg-card: rgba(250, 249, 241, 0.82);
  --bg-card-hover: #f8f7ef;
  --border: rgba(23, 33, 36, 0.14);
  --border-active: rgba(113, 134, 79, 0.5);
  --text-main: #172124;
  --text-muted: #687570;
  --accent: #71864f;
  --accent-glow: rgba(214, 237, 132, 0.35);
  --titanium: #202a2d;
  --lime: #d6ed84;
  --coral: #e97c60;
  --font-main: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--bg-core);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(214, 237, 132, 0.22), transparent),
    radial-gradient(circle at 100% 100%, rgba(23, 33, 36, 0.035), transparent);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

#doodle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.site-header,
main,
.site-footer {
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  background: rgba(241, 239, 229, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 0;
  border: 1px solid var(--titanium);
  background: var(--titanium);
  box-shadow: 4px 4px 0 #ccd3b9;
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
}

.brand-text {
  font-size: 0.95rem;
  font-family: var(--font-mono);
  color: var(--text-main);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 0.4rem;
}

.site-nav a {
  padding: 0.45rem 0.9rem;
  border-radius: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-main);
  background: rgba(23, 33, 36, 0.045);
  border-color: var(--border);
}

/* Hero Section */
.hero {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 320px);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
}

.hero-copy h1,
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.055em;
  margin: 0 0 1.25rem;
}

.hero-summary {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.65;
  margin-bottom: 2rem;
}

/* Buttons */
.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.25s ease;
}

.button.primary {
  background: var(--titanium);
  color: #f1efe5;
  border: 1px solid var(--titanium);
  box-shadow: 0 5px 15px rgba(23, 33, 36, 0.12);
}

.button.primary:hover {
  background: #303d39;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(23, 33, 36, 0.18);
}

.button.secondary {
  background: rgba(250, 249, 241, 0.58);
  color: var(--text-main);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.button.secondary:hover {
  background: rgba(214, 237, 132, 0.2);
  border-color: rgba(113, 134, 79, 0.4);
  transform: translateY(-2px);
}

/* Profile Card */
.profile-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.2rem;
  box-shadow: 0 16px 36px rgba(23, 33, 36, 0.09);
  transition: border-color 0.3s ease;
}

.profile-card:hover {
  border-color: rgba(23, 33, 36, 0.25);
}

.profile-image {
  border-radius: 2px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.profile-card strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-main);
}

.profile-card span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Module Grid */
.subject-section,
.contact-section,
.page-hero,
.content-layout {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}

.section-heading h2,
.content-layout h2,
.contact-section h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  margin: 0 0 0.8rem;
}

.section-heading p {
  color: var(--text-muted);
  max-width: 600px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.section-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2.2rem 1.8rem;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(23, 33, 36, 0.1);
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(214, 237, 132, 0.24);
  border: 1px solid rgba(113, 134, 79, 0.23);
  border-radius: 0;
  padding: 0.25rem 0.55rem;
  align-self: flex-start;
  margin-bottom: 1.25rem;
}

.section-card strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
}

.section-card small {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Subpages Content Layout */
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 340px);
  gap: 2rem;
}

.content-panel,
.sticky-note {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2.2rem;
}

.lined-entry,
.project-list article,
.timeline-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.lined-entry:first-of-type,
.project-list article:first-of-type,
.timeline-item:first-of-type {
  border-top: none;
  padding-top: 0.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.2rem;
}

.timeline-item time,
.lined-entry span {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent);
}

.lined-entry h3,
.project-list article h3,
.timeline-item h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.project-title-link {
  color: inherit;
  text-decoration: none;
}

.project-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.project-title-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.lined-entry p,
.project-list article p,
.timeline-item p,
.sticky-note p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin: 0;
}

/* Technical Skill Chips */
.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.8rem;
}

.skill-cloud span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0;
  background: rgba(23, 33, 36, 0.04);
  border: 1px solid var(--border);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.skill-cloud span:hover {
  border-color: rgba(113, 134, 79, 0.42);
  background: rgba(214, 237, 132, 0.18);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.check-list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Contact Module */
.contact-section {
  background: linear-gradient(135deg, #e9eadc, #f8f7ef);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0 3rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.site-footer a:hover {
  color: var(--text-main);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Responsiveness */
@media (max-width: 900px) {
  .hero-grid,
  .content-layout,
  .contact-section,
  .section-grid {
    grid-template-columns: 1fr;
  }
}
/* Apple-style Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Stagger delay for side-by-side cards */
.section-grid .reveal:nth-child(1) { transition-delay: 0.05s; }
.section-grid .reveal:nth-child(2) { transition-delay: 0.15s; }
.section-grid .reveal:nth-child(3) { transition-delay: 0.25s; }

.achievement-section {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
  border-top: 1px solid var(--border);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.25rem;
}

.achievement-card {
  min-height: 190px;
  padding: 1.6rem 1.7rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  background: var(--bg-card);
  box-shadow: 0 10px 26px rgba(23, 33, 36, 0.045);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.achievement-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
  box-shadow: 0 14px 30px rgba(23, 33, 36, 0.09);
}

.achievement-date {
  color: var(--accent);
  font: 500 0.72rem var(--font-mono);
  letter-spacing: 0.08em;
}

.achievement-card h3 {
  margin: 0.75rem 0 0.45rem;
  font: 600 1.35rem/1.2 var(--font-display);
  letter-spacing: -0.035em;
}

.achievement-card p {
  max-width: 54ch;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.project-list p a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.project-list p a:hover {
  color: var(--text-main);
}

/* Openable galleries for project and achievement media */
.achievement-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.achievement-card-link:focus-visible,
.media-disclosure summary:focus-visible,
.media-gallery a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.achievement-thumb {
  width: 100%;
  height: 112px;
  margin: 0.9rem 0 0.35rem;
  object-fit: cover;
  border: 1px solid var(--border);
}

.achievement-card .project-open-link {
  display: inline-flex;
  margin-top: 0.55rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.project-list .project-open-link {
  display: inline-flex;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.media-disclosure {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.media-disclosure summary {
  cursor: pointer;
  color: var(--accent);
  font: 500 0.85rem var(--font-mono);
  list-style: none;
}

.media-disclosure summary::-webkit-details-marker {
  display: none;
}

.media-disclosure summary::after {
  content: "+";
  float: right;
  font-size: 1.1rem;
}

.media-disclosure[open] summary::after {
  content: "−";
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.media-gallery figure {
  min-width: 0;
  margin: 0;
}

.media-gallery img,
.media-gallery video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e7e7de;
  border: 1px solid var(--border);
}

.media-gallery video {
  object-fit: contain;
}

.media-gallery figcaption {
  display: none;
}

.project-media-page {
  padding-bottom: 4rem;
}

.project-media-panel {
  margin-bottom: 1.5rem;
}

.project-media-panel > p {
  max-width: 70ch;
  color: var(--text-muted);
}

.project-media-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-media-gallery img,
.project-media-gallery video {
  aspect-ratio: 16 / 11;
}

.laser-main-video {
  width: 100%;
  margin: 1rem 0 1.5rem;
}

.laser-main-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #e7e7de;
  border: 1px solid var(--border);
}

.lead-video figure:first-child {
  grid-column: 1 / -1;
}

.lead-video figure:first-child video {
  aspect-ratio: 16 / 9;
}

.media-note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sticky-note h3 {
  margin: 0.8rem 0 0.55rem;
  font: 600 1rem var(--font-display);
}

.aviation-note .button {
  margin-top: 0.4rem;
}

@media (max-width: 700px) {
  .achievement-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .achievement-card {
    min-height: auto;
    padding: 1.35rem 1.2rem;
  }

  .project-media-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 440px) {
  .media-gallery,
  .project-media-gallery {
    grid-template-columns: 1fr;
  }
}

/* Respect reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.flight-log-section {
  margin-top: 1rem;
  padding: clamp(3rem, 6vw, 5.5rem) 0 4rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 90px;
}

.flight-log-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
}

.flight-log-heading h2 {
  font-family: var(--font-display);
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  line-height: 1.15;
}

.flight-log-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--text-muted);
}

.flight-frame {
  margin-top: 2rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #f1efe5;
  box-shadow: 0 16px 40px rgba(23, 33, 36, 0.12);
}

.flight-frame iframe {
  display: block;
  width: 100%;
  height: 1450px;
  border: 0;
  background: #f1efe5;
}

@media (max-width: 900px) {
  .flight-log-heading {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.25rem;
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.2rem;
  }

  .site-nav a {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .flight-frame iframe {
    height: 1750px;
  }
}

@media (max-width: 420px) {
  .flight-frame iframe {
    height: 1800px;
  }
}
