:root {
  color-scheme: light;
  --background: #f4efe6;
  --background-accent: #e5ddd0;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: #fffdf9;
  --text: #1f1a17;
  --muted: #645a52;
  --line: rgba(31, 26, 23, 0.12);
  --brand: #145a4a;
  --brand-deep: #0d3d33;
  --github-tint: rgba(20, 90, 74, 0.12);
  --linkedin-tint: rgba(10, 102, 194, 0.12);
  --email-tint: rgba(184, 100, 50, 0.14);
  --shadow: 0 20px 60px rgba(31, 26, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(20, 90, 74, 0.14), transparent 32%),
    radial-gradient(circle at bottom right, rgba(167, 110, 64, 0.18), transparent 28%),
    linear-gradient(180deg, var(--background), var(--background-accent));
}

a {
  color: inherit;
}

.page-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.page-topbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 1.5rem;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.source-link:hover,
.source-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(20, 90, 74, 0.28);
  box-shadow: var(--shadow);
  color: var(--brand);
}

.source-link-icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  flex: 0 0 auto;
}

.hero {
  padding: 4rem 1.5rem 3rem;
  transition:
    padding 260ms ease,
    transform 260ms ease,
    max-width 340ms ease;
  transform-origin: top left;
}

.hero-subtitle,
.section-label {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand);
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  line-height: 0.95;
}

h1 {
  font-size: clamp(3.6rem, 10vw, 7rem);
  white-space: nowrap;
}

.hero-cursor {
  display: inline-block;
  animation: cursor-blink 1s steps(1, end) infinite;
  transition: opacity 180ms ease;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.lede,
.card p,
.site-footer p {
  line-height: 1.7;
  font-size: 1rem;
  color: var(--muted);
}

.card-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.card-list li + li {
  margin-top: 0.7rem;
}

.lede {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  font-size: 1.15rem;
  transition:
    margin 260ms ease,
    opacity 220ms ease,
    transform 260ms ease,
    max-height 260ms ease;
}

.hero-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.9rem;
  margin-top: 2rem;
  transition:
    gap 260ms ease,
    margin-top 260ms ease,
    transform 260ms ease;
  transform-origin: top left;
  max-width: 100%;
}

.hero-subtitle {
  margin-top: 0.9rem;
  max-width: 32rem;
  line-height: 1.4;
  transition:
    opacity 220ms ease,
    transform 260ms ease,
    max-height 260ms ease,
    margin 260ms ease;
}

.hero .hero-subtitle {
  transition:
    opacity 220ms ease,
    transform 260ms ease,
    max-height 260ms ease,
    margin 260ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: inherit;
  font: inherit;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.button:disabled {
  transform: none;
  box-shadow: none;
  opacity: 0.7;
  cursor: wait;
}

.button-github {
  color: var(--brand);
  background: var(--github-tint);
  border-color: rgba(20, 90, 74, 0.24);
}

.button-github:hover,
.button-github:focus-visible {
  background: rgba(20, 90, 74, 0.18);
  border-color: rgba(20, 90, 74, 0.36);
}

.button-linkedin {
  color: #0a66c2;
  background: var(--linkedin-tint);
  border-color: rgba(10, 102, 194, 0.24);
}

.button-linkedin:hover,
.button-linkedin:focus-visible {
  background: rgba(10, 102, 194, 0.18);
  border-color: rgba(10, 102, 194, 0.34);
}

.button-email {
  color: #b86432;
  background: var(--email-tint);
  border-color: rgba(184, 100, 50, 0.24);
}

.button-email:hover,
.button-email:focus-visible {
  background: rgba(184, 100, 50, 0.2);
  border-color: rgba(184, 100, 50, 0.34);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  padding: 0 1.5rem;
}

.card {
  grid-column: span 6;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: 1.6rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.js .card {
  opacity: 0;
  transform: translateY(2.5rem);
}

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

.accent-card {
  background:
    linear-gradient(135deg, rgba(20, 90, 74, 0.12), rgba(255, 255, 255, 0.9)),
    var(--surface-strong);
}

.wide-card {
  grid-column: 1 / -1;
}

.heatmap-card {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.aside-card {
  grid-column: 8 / -1;
  padding: 1.2rem 1.4rem;
  background: rgba(255, 255, 255, 0.58);
}

.aside-card p {
  font-size: 0.95rem;
}

.prime-formula {
  display: inline-block;
  white-space: nowrap;
}

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

.heatmap-link {
  display: block;
  padding: 1rem;
  border: 1px solid rgba(20, 90, 74, 0.16);
  border-radius: 1.25rem;
  background:
    linear-gradient(135deg, rgba(20, 90, 74, 0.08), rgba(255, 255, 255, 0.8)),
    rgba(255, 255, 255, 0.82);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.heatmap-link:hover,
.heatmap-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(20, 90, 74, 0.32);
  box-shadow: var(--shadow);
}

.heatmap-image {
  display: block;
  width: 100%;
  height: auto;
}

.site-footer {
  padding: 2rem 1.5rem 0;
}

@media (min-width: 900px) {
  body.has-sidebar .page-shell {
    display: grid;
    grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
    column-gap: 2rem;
    align-items: start;
  }

  body.has-sidebar .hero {
    position: sticky;
    top: 1.5rem;
    padding: 1.5rem 0 0 1.5rem;
    align-self: start;
    max-width: 17rem;
  }

  body.has-sidebar .hero .hero-subtitle,
  body.has-sidebar .hero .lede {
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(-0.6rem);
    pointer-events: none;
  }

  body.has-sidebar .hero h1 {
    font-size: clamp(2rem, 2.8vw, 2.8rem);
    line-height: 1;
  }

  body.has-sidebar .hero-cursor {
    opacity: 0;
  }

  body.has-sidebar .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.25rem;
  }

  body.has-sidebar .content-grid {
    padding: 0 1.5rem 0 0;
  }

  body.has-sidebar .page-topbar {
    grid-column: 1 / -1;
    padding: 0 1.5rem 1rem;
  }

  body.has-sidebar .site-footer {
    grid-column: 2;
    padding: 2rem 1.5rem 0 0;
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 26, 23, 0.5);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(100%, 36rem);
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.96),
    rgba(244, 239, 230, 0.98)
  );
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-copy {
  margin: 1rem 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.contact-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
}

.form-field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(31, 26, 23, 0.14);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
  color: var(--text);
}

.form-field input:focus,
.form-field textarea:focus,
.modal-close:focus-visible {
  outline: 2px solid rgba(20, 90, 74, 0.3);
  outline-offset: 2px;
}

.form-field textarea {
  min-height: 9rem;
  resize: vertical;
}

.form-status {
  min-height: 1.5rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.form-status[data-state="error"] {
  color: #a53a2f;
}

.form-status[data-state="success"] {
  color: var(--brand);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes cursor-blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero .hero-subtitle,
  .hero .lede,
  .hero-actions,
  .hero-cursor {
    transition: none;
  }

  .hero-cursor {
    animation: none;
  }

  .card {
    transition: none;
  }

  .js .card,
  .js .card.is-visible {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .page-topbar {
    padding: 0 0 0.5rem;
  }

  .hero {
    padding-top: 3rem;
  }

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

  .card,
  .wide-card {
    grid-column: auto;
  }

  .aside-card {
    grid-column: auto;
  }

  .heatmap-card {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 1rem;
  }

  .modal-panel {
    padding: 1.4rem;
  }
}
