:root {
  --ink: #11120f;
  --muted: #51534a;
  --accent: #b96a3b;
  --accent-dark: #874423;
  --paper: #f6f1ea;
  --paper-deep: #efe6dc;
  --mist: #e2d8cc;
  --shadow: rgba(18, 18, 15, 0.12);
  --radius: 20px;
  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-serif: "Fraunces", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: radial-gradient(circle at top left, #fef8f2 0%, #f5efe6 45%, #eee3d6 100%);
  line-height: 1.6;
}

a {
  color: #1f5bcc;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid rgba(31, 91, 204, 0.45);
  outline-offset: 3px;
}

.external-link {
  color: #1f5bcc;
  text-decoration: underline;
  text-underline-offset: 3px;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23000000' fill-opacity='0.06'%3E%3Ccircle cx='10' cy='10' r='1'/%3E%3Ccircle cx='40' cy='50' r='1'/%3E%3Ccircle cx='80' cy='90' r='1'/%3E%3Ccircle cx='100' cy='20' r='1'/%3E%3Ccircle cx='70' cy='30' r='1'/%3E%3Ccircle cx='20' cy='80' r='1'/%3E%3C/g%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: rgba(246, 241, 234, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(17, 18, 15, 0.08);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.nav {
  display: flex;
  gap: 18px;
  font-weight: 500;
}

.nav a {
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
}

.hero {
  display: block;
  padding: 40px 0 40px;
  position: relative;
  z-index: 1;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: center;
}

.hero-copy h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.04rem, 2.55vw + 0.85rem, 3.06rem);
  line-height: 1.15;
  margin: 0 0 28px;
  max-width: 620px;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button.primary {
  background: var(--ink);
  color: #f9f5ef;
  border-color: var(--ink);
  box-shadow: 0 10px 30px rgba(17, 18, 15, 0.2);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 18, 15, 0.18);
}

.hero-meta {
  display: grid;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.meta-label {
  display: block;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--accent-dark);
}

.hero-media {
  position: relative;
  padding: 14px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(239, 230, 220, 0.5));
  border: 1px solid rgba(17, 18, 15, 0.08);
  box-shadow: 0 24px 60px rgba(17, 18, 15, 0.15);
}

.hero-photo {
  border-radius: 22px;
  overflow: hidden;
  background: #f1ebe3;
  aspect-ratio: 9 / 16;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
  transition: opacity 0.35s ease, transform 0.6s ease;
}

.hero-photo img.fade-out {
  opacity: 0;
  transform: scale(1.01);
}

.section {
  padding: 70px 0 36px;
  position: relative;
  z-index: 1;
}

.section-header {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
  position: relative;
}

.section-header::after {
  content: '';
  width: 56px;
  height: 2px;
  background: linear-gradient(90deg, rgba(17, 18, 15, 0.35), transparent);
}

.section-header h1,
.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 2.1vw + 1rem, 2.5rem);
  margin: 0;
}

.section-header p {
  color: var(--muted);
  max-width: 680px;
  margin: 0;
}

.independent {
  padding: 44px 0 10px;
}

.independent .section-header {
  margin-bottom: 8px;
}

.independent-note {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 0.95rem;
}

.independent-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-grid,
.work-grid,
.services-grid,
.resume-grid,
.contact-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.education-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 24px;
}

.about-card,
.work-card,
.service-card,
.resume-card,
.contact-card,
.resume-block {
  background: #fbf7f2;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(17, 18, 15, 0.08);
  box-shadow: 0 12px 30px rgba(17, 18, 15, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.about-card:hover,
.work-card:hover,
.service-card:hover,
.resume-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(17, 18, 15, 0.14);
}

.work-card p,
.service-card ul,
.resume-block ul {
  color: var(--muted);
}

.tag {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-deep);
  font-size: 0.8rem;
  font-weight: 600;
}

.service-card ul,
.resume-block ul {
  padding-left: 18px;
  margin: 12px 0 0;
}

.resume-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.resume-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.resume-grid {
  margin-top: 24px;
}

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

.contact-grid {
  grid-template-columns: 1fr;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px 28px;
  border-top: 1px solid rgba(17, 18, 15, 0.08);
  background: #f1e7db;
}

.footer a {
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.services-stack {
  grid-template-columns: 1fr;
}

@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    max-width: 420px;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  .nav {
    position: absolute;
    top: 70px;
    right: 20px;
    background: #f8f2ea;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(17, 18, 15, 0.2);
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

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

  .menu-toggle {
    display: block;
  }

  .hero {
    padding-top: 60px;
  }

  .footer {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 16px 20px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .resume-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section,
.hero-card,
.work-card,
.service-card,
.contact-card,
.contact-form {
  animation: floatIn 0.8s ease both;
}

.section:nth-of-type(2) {
  animation-delay: 0.1s;
}

.section:nth-of-type(3) {
  animation-delay: 0.2s;
}

.section:nth-of-type(4) {
  animation-delay: 0.3s;
}

.section:nth-of-type(5) {
  animation-delay: 0.4s;
}
