:root {
  --bg: #101214;
  --bg-alt: #182325;
  --card: #17191c;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text: #f6f4ef;
  --muted: #c1ab85;
  --accent: #f75142;
  --accent-soft: rgba(201, 78, 68, 0.22);
  --accent-alt: #c1ab85;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.5);
  --max-width: 1100px;
  --transition: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, #3e6868 0, #101214 55%, #050608 100%);
  color: var(--text);
  line-height: 1.6;
  position: relative;
}

/* Grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='noStitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

/* Keep page content above the grain layer */
header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* Layout helpers */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 2.5rem 0;
}

.section-alt {
  padding: 2.5rem 0;
  background:
    radial-gradient(circle at top right, rgba(62, 104, 104, 0.32), transparent 60%),
    #101214;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom: 1px solid rgba(10, 10, 10, 0.9);
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  margin-top: 0;
}

.section p {
  color: var(--muted);
}

/* Header & nav */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(10, 16, 20, 0.98);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
}

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

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

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color var(--transition), transform var(--transition);
}

.nav-links a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* Mobile nav toggle */

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  margin: 0;
}

/* Hero */

.hero {
  padding: 4.5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
  gap: 3rem;
  align-items: center;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-alt);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  margin: 0 0 0.6rem;
}

.hero .accent {
  color: var(--accent);
}

.hero-subtitle {
  max-width: 32rem;
  color: var(--muted);
  margin-bottom: 1.8rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Hero card */

.hero-card {
  justify-self: flex-end;
}

.hero-card-inner {
  background:
    radial-gradient(circle at top right, rgba(201, 78, 68, 0.3), transparent 60%), 
    var(--card);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.8rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.hero-card-inner h2 {
  font-size: 1.1rem;
  margin-top: 0;
}

.hero-card-inner p {
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.hero-card-inner ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.hero-card-inner li {
  font-size: 0.9rem;
  color: #f0e8d5;
  margin-bottom: 0.3rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-size: 0.95rem;
  -webkit-appearance: none;
  appearance: none;
  border: 2px solid transparent;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn.primary {
  background: linear-gradient(135deg, #c94e44 0%, #cc7b5f 50%, #c1ab85 100%);
  color: #0a0a0a;
  font-weight: 600;
  box-shadow: 0 14px 30px rgba(201, 78, 68, 0.2);
  border: 2px solid rgba(130, 50, 45, 0.96);
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(201, 78, 68, 0.275);
}

.btn.ghost {
  background: transparent;
  border: 2px solid rgba(193, 171, 133, 0.96);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: rgba(193, 171, 133, 1);
  background: rgba(193, 171, 133, 0.1);
}

.btn.full-width {
  width: 100%;
}

/* Section layouts */

.section-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr);
  align-items: flex-start;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.highlight {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border-subtle);
  width: 100%;
}

.highlight h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.highlight ul {
  padding-left: 1rem;
  margin: 0;
}

.highlight li {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Projects */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(193, 171, 133, 0.4);
  background: rgba(14, 18, 20, 0.96);
  color: rgba(193, 171, 133, 0.7);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition), transform var(--transition);
}

.filter-btn.active {
  background: var(--accent-soft);
  border-color: rgba(201, 78, 68, 1);
  color: #f6f4ef;
  transform: translateY(-1px);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  box-shadow: 0 14px 30px rgba(3, 4, 5, 0.9);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(62, 104, 104, 0.16), transparent 55%);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.project-card:hover {
  border-color: rgba(201, 78, 68, 0.8);
}

.project-card > * {
  position: relative;
  z-index: 1;
}

.project-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  overflow: hidden;
  margin: -0.25rem -0.25rem 0.9rem;
  background: transparent;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.project-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 100%;
}

@supports not (aspect-ratio: 16 / 9) {
  .project-hero {
    height: 0;
    padding-top: 56.25%;
  }

  .project-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.project-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-alt);
  position: relative;
}

.project-card h3 {
  margin: 0;
  font-size: 1.05rem;
  position: relative;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
  margin: 0;
}

.project-meta {
  list-style: none;
  padding-left: 0;
  margin: 0;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-meta li {
  font-size: 0.82rem;
  color: #f3e8da;
  margin: 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(193, 171, 133, 0.45);
  background: rgba(193, 171, 133, 0.08);
  display: inline-flex;
  align-items: center;
}

.project-meta .extra-skill {
  display: none;
}

.project-card[data-expanded="true"] .project-meta .extra-skill {
  display: inline-flex;
}

.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-start;
}

.skill-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px dashed rgba(193, 171, 133, 0.6);
  background: rgba(16, 18, 20, 0.8);
  color: var(--accent-alt);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.skill-toggle:hover {
  border-color: rgba(201, 78, 68, 0.7);
  color: var(--accent);
  transform: translateY(-1px);
}

.project-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  position: relative;
  margin-top: auto;
}

.project-links a {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

.project-card.enceladus65 {
}


/* Experience */

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.experience-item {
  border-left: 2px solid rgba(201, 78, 68, 0.4);
  padding-left: 1.5rem;
  position: relative;
}

.experience-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.experience-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.experience-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.experience-company {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.experience-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.experience-details {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.experience-details li {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
/* (RESUME watermark removed per request) */

/* Skills */

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

.skill-group {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.4rem 1.5rem;
}

.skill-group h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.skill-group ul {
  padding-left: 1rem;
  margin: 0;
}

.skill-group li {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Contact */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
  gap: 2rem;
  align-items: flex-start;
}

.contact-list {
  list-style: none;
  padding-left: 0;
  margin-top: 1.2rem;
}

.contact-list li {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

.contact-form {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem 1.6rem;
}

.contact-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-top: 0.25rem;
  margin-bottom: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(51, 65, 85, 0.9);
  background: #0b0f10;
  color: var(--text);
  font: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(201, 78, 68, 0.9);
  box-shadow: 0 0 0 1px rgba(201, 78, 68, 0.6);
}

.form-note {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.form-note a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

.form-note a:hover {
  text-decoration: underline;
}

/* PDF slideshow embed (Student Maker Tutorials) */
.pdf-slideshow {
  width: 100%;
  max-width: 980px;
  margin: 1rem auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  background: var(--card);
  display: block;
  position: relative;
}

/* Preferred: modern browsers use aspect-ratio */
@supports (aspect-ratio: 16/10) {
  .pdf-slideshow {
    aspect-ratio: 16 / 10;
    height: auto;
    min-height: 300px;
    max-height: 820px;
  }

  .pdf-slideshow object {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
  }
}

/* Fallback: use padding-top trick for browsers without aspect-ratio */
@supports not (aspect-ratio: 16/10) {
  .pdf-slideshow {
    /* 10 / 16 = 62.5% */
    padding-top: 62.5%;
    min-height: 260px;
  }

  .pdf-slideshow object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
  }
}

.pdf-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.6rem;
}

.pdf-slideshow a {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .pdf-slideshow {
    /* Keep 16:10 but allow a slightly taller minimum on small screens */
    aspect-ratio: 16 / 10;
    min-height: 260px;
    max-height: 640px;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(5, 6, 7, 0.9);
  background: #0b0d0e;
  padding: 1.3rem 0 1.6rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.back-to-top {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

/* Responsive */

@media (max-width: 900px) {
  .hero-grid,
  .section-grid,
  .skills-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    justify-self: stretch;
  }

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

.project-card.enceladus65 {
  order: 1;
}

.project-card.student-maker {
  order: 2;
}

.project-card.sample-subway {
  order: 3;
}

.project-card.project-template {
  order: 4;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    right: 1.5rem;
    top: 3.4rem;
    flex-direction: column;
    background: #050608;
    padding: 0.9rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .hero {
    padding-top: 3.4rem;
  }

  .skills-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
