:root {
  /* Palette from Figma styles */
  --blue-1: #4FB2B5;
  --blue-2: #D5F2E7;
  --yellow-1: #B5C646;
  --yellow-2: #F0F5C7;
  --green-7: #1B4530;
  --green-6: #2C804E;
  --green-5: #339359;
  --green-4: #48B376;
  --green-3: #92E1A6;
  --green-2: #E5F0E2;
  --green-1: #F2F7F0;
  --red-1: #EE6029;
  --red-tint: #FCEDE6;
  --orange-1: #EC8E25;
  --grey-6: #222222;
  --grey-5: #6A6A6A;
  --grey-4: #9D9D9D;
  --grey-3-1: #CFCFCF;
  --grey-3: #E0E0E0;
  --grey-2: #EEEEEE;
  --grey-1: #F5F5F5;
  --white: #FFFFFF;

  /* Roles */
  --ink: var(--grey-6);
  --ink-soft: #565C58;
  --paper: var(--white);
  --paper-tint: var(--green-1);
  --pine: var(--green-7);
  --accent: var(--green-5);
  --accent-deep: var(--green-6);
  --accent-mint: var(--green-3);
  --line: #DCE7DD;
  --max: 1080px;

  --font-display: "Zilla Slab", "Rockwell", serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container.narrow {
  max-width: 800px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
}

h2 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin-bottom: 2rem;
}

h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  margin-top: 0.6rem;
  background: var(--green-4);
  border-radius: 2px;
}

section, footer.contact {
  padding: 5rem 0;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 6px;
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

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

.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

/* On the pine contact band, the primary action flips to mint */
.contact .btn-primary {
  background: var(--accent-mint);
  color: var(--pine);
}

.contact .btn-primary:hover {
  background: var(--white);
}

/* Hero */
.hero {
  background: var(--paper-tint);
  border-bottom: 1px solid var(--line);
  padding-bottom: 5.5rem;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 0;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}

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

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-deep);
  text-decoration: none;
}

.nav-cta:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2.25rem 3.5rem;
  align-items: center;
  padding-top: 4rem;
}

/* Desktop: copy and CTA stack in the left column, diff card centered beside them */
.hero-copy {
  grid-column: 1;
  grid-row: 1;
}

.hero-grid .diff-card {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.hero-cta {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.15rem);
  line-height: 1.12;
  margin-bottom: 1.4rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-deep);
}

.subhead {
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 34em;
}

/* Signature: the hero diff */
.diff-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem 1.5rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.7;
  box-shadow: 0 16px 40px rgba(44, 128, 78, 0.10);
}

.diff-hunk {
  color: var(--grey-4);
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
}

.diff-line {
  display: flex;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
  animation: diff-in 0.5s ease both;
}

.diff-sign {
  flex: none;
  font-weight: 500;
}

.diff-minus {
  background: var(--red-tint);
  color: #B4441B;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  animation-delay: 0.25s;
}

.diff-plus {
  background: var(--green-2);
  color: var(--accent-deep);
  font-weight: 500;
  animation-delay: 0.85s;
}

.diff-comment {
  opacity: 0.6;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.35rem;
  vertical-align: text-bottom;
  background: var(--green-4);
  animation: blink 1.1s steps(1) infinite;
  animation-delay: 1.4s;
  opacity: 0;
}

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Services */
.service-list {
  margin-top: 0.5rem;
}

.service-row {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.service-row:first-child {
  border-top: 1px solid var(--line);
}

.service-row h3 {
  font-size: 1.3rem;
  line-height: 1.3;
}

/* Diff semantics carried through: each service is a line I add */
.service-row h3::before {
  content: "+";
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent);
  margin-right: 0.6rem;
}

.service-row p {
  color: var(--ink-soft);
}

/* Why me */
.why {
  background: var(--paper-tint);
}

.why-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 3.5rem;
  margin-top: 0.5rem;
}

.why-list h3 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.why-list p {
  color: var(--ink-soft);
}

/* Area of expertise */
.stack-list {
  margin-top: 0.5rem;
}

.stack-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.stack-row:first-child {
  border-top: 1px solid var(--line);
}

.stack-row dt {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-deep);
  padding-top: 0.2rem;
}

.stack-row dd {
  color: var(--ink-soft);
}

/* About */
.about {
  background: var(--paper-tint);
}

.about p + p {
  margin-top: 1.25rem;
}

/* Contact / footer */
.contact {
  background: var(--pine);
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.contact h2 {
  color: var(--white);
}

.contact h2::after {
  margin-left: auto;
  margin-right: auto;
  background: var(--accent-mint);
}

.contact-details {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  margin: 1.5rem 0 2rem;
  line-height: 2.1;
}

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

.contact-details a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-note {
  margin-top: 3.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Contact modal */
.modal {
  /* The * reset removes the UA margin:auto that centers a dialog */
  margin: auto;
  border: none;
  border-radius: 10px;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 3rem);
  box-shadow: 0 24px 60px rgba(27, 69, 48, 0.35);
}

.modal::backdrop {
  background: rgba(27, 69, 48, 0.55);
}

.modal-inner {
  padding: 2rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.modal-close {
  border: none;
  background: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--grey-5);
  cursor: pointer;
  padding: 0 0.25rem;
}

.modal-close:hover {
  color: var(--ink);
}

.field {
  display: block;
  margin-bottom: 1.25rem;
}

.field span {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--grey-3-1);
  border-radius: 6px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--green-2);
}

.field textarea {
  resize: vertical;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.form-error {
  color: var(--red-1);
  margin-bottom: 1rem;
}

.form-success p + p {
  margin-top: 0.75rem;
  color: var(--ink-soft);
}

/* Responsive */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.75rem;
    padding-top: 2.5rem;
  }

  /* Single column, source order: copy, diff card, CTA last */
  .hero-copy,
  .hero-grid .diff-card,
  .hero-cta {
    grid-area: auto;
  }

  .diff-card {
    max-width: 480px;
  }
}

@media (max-width: 960px) {
  .service-row {
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 720px) {
  section, footer.contact {
    padding: 3.25rem 0;
  }

  h2 {
    font-size: 1.75rem;
  }

  .why-list {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .service-row,
  .stack-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .diff-card {
    font-size: 0.85rem;
    padding: 1.1rem 1.1rem 1.2rem;
  }
}

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

  .diff-line {
    animation: none;
  }

  .caret {
    animation: none;
    opacity: 1;
  }

  .btn-primary:hover {
    transform: none;
  }
}
