:root {
  --bg: #f7f7f4;
  --ink: #111;
  --muted: #6d6d68;
  --line: #d7d7d0;
  --accent: #e8ff3f;
  --pad: clamp(18px, 4vw, 56px);
  --max: 1380px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 58px;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(247,247,244,.94);
  backdrop-filter: blur(8px);
}

.wordmark {
  font-weight: 700;
  letter-spacing: -0.05em;
}

nav, .header-links {
  display: flex;
  gap: 22px;
  font-size: 12px;
}

.header-links { justify-self: end; }

.header-links {
  align-items: center;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  margin-left: 2px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  transition: background 140ms ease, color 140ms ease;
}

.contact-button:hover,
.contact-button:focus-visible {
  background: var(--accent);
  color: var(--ink);
  outline: none;
}


main, footer {
  width: min(100%, calc(var(--max) + var(--pad) * 2));
  margin: 0 auto;
}

.intro {
  padding: 72px var(--pad) 54px;
}

.intro-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

h1 {
  margin: 26px 0 34px;
  font-size: clamp(58px, 11vw, 150px);
  line-height: .82;
  letter-spacing: -0.075em;
  font-weight: 700;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 48px;
  align-items: start;
}

.intro-copy {
  margin: 0;
  max-width: 760px;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.intro-meta {
  border-top: 1px solid var(--ink);
}

.intro-meta > div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.intro-meta strong,
.intro-meta a {
  grid-column: 2;
  font-weight: 600;
}

.intro-meta > div > span:last-child {
  grid-column: 2;
  color: var(--muted);
}

.label {
  grid-row: 1 / span 2;
  color: var(--muted);
}

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--accent);
}

.ticker-track {
  width: max-content;
  padding: 9px 0;
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 12px;
  animation: ticker 30s linear infinite;
}

.ticker-track i {
  font-style: normal;
  opacity: .55;
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

.section {
  padding: 58px var(--pad) 70px;
}

.section + .section {
  border-top: 1px solid var(--ink);
}

.section-head {
  display: grid;
  grid-template-columns: 44px 1fr 1fr;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 30px;
}

.section-head .index {
  color: var(--muted);
  font-size: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.section-head p {
  margin: 0;
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
}

.rows {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 110px minmax(280px, .8fr) 1.2fr;
  gap: 24px;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
}

.row-date {
  color: var(--muted);
  font-size: 12px;
  padding-top: 3px;
}

.row-main h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.sub {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.row-copy {
  max-width: 680px;
  color: #333;
  font-size: 14px;
  line-height: 1.45;
}


.skill-table {
  border-top: 1px solid var(--ink);
}

.skill-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.skill-row > span {
  color: var(--muted);
  font-size: 12px;
}

.skill-row p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.education {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}

.education article {
  min-height: 220px;
  padding: 18px 18px 18px 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.education article + article {
  padding-left: 18px;
}

.education article:last-child {
  border-right: 0;
}

.year {
  color: var(--muted);
  font-size: 12px;
}

.education h3 {
  margin: auto 0 8px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.education p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

footer {
  padding: 18px var(--pad) 28px;
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  font-size: 12px;
}

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

footer button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  nav { display: none; }

  .intro-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 90px 1fr;
  }

  .row-copy {
    grid-column: 2;
  }

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

  .education article {
    min-height: 150px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 0 !important;
  }

  .education article:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
  .header-links a:not(.contact-button) { display: none; }

  .contact-button {
    min-height: 32px;
    padding: 0 11px;
  }

  .intro {
    padding-top: 48px;
  }

  .intro-topline {
    flex-direction: column;
  }

  h1 {
    font-size: clamp(58px, 20vw, 94px);
  }

  .section-head {
    grid-template-columns: 34px 1fr;
  }

  .section-head p {
    grid-column: 2;
    justify-self: start;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .row-copy { grid-column: 1; }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  footer {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
}

/* Popup contact form */
.contact-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  min-height: 34px;
  padding: 0 13px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.contact-button:hover,
.contact-button:focus-visible {
  background: var(--accent);
  color: var(--ink);
  outline: none;
}

.contact-modal[hidden] {
  display: none;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.contact-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 17, 17, .58);
  backdrop-filter: blur(3px);
  cursor: default;
}

.contact-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .22);
  animation: contact-pop 150ms ease-out;
}

@keyframes contact-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.99);
  }
}

.contact-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.contact-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.contact-dialog h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 46px);
  line-height: .95;
  letter-spacing: -0.055em;
}

.contact-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.contact-close:hover,
.contact-close:focus-visible {
  background: var(--ink);
  color: var(--bg);
  outline: none;
}

.contact-dialog-copy {
  margin: 0;
  padding: 14px 22px 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#contact-form {
  padding: 10px 22px 22px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ink);
}

#contact-form label {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.field-grid label:first-child {
  padding-right: 12px;
}

.field-grid label:last-child {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

#contact-form label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

#contact-form input {
  min-height: 34px;
}

#contact-form textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.45;
}

#contact-form input:focus,
#contact-form textarea:focus {
  background: #efefe9;
}

#contact-form [aria-invalid="true"] {
  background: #fff0eb;
}

#contact-form small[data-fs-error] {
  display: block;
  margin-top: 5px;
  color: #a12810;
  font-size: 11px;
}

.contact-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}

.contact-actions > span {
  color: var(--muted);
  font-size: 11px;
}

.submit-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  font-weight: 700;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: var(--accent);
  color: var(--ink);
  outline: none;
}

.submit-button:disabled {
  opacity: .55;
  cursor: wait;
}

.form-success,
.form-error {
  margin: 0 22px;
  font-size: 12px;
  line-height: 1.4;
}

.form-success:not(:empty) {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  background: var(--accent);
}

.form-error:not(:empty) {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #a12810;
  color: #a12810;
}

body.contact-open {
  overflow: hidden;
}

@media (max-width: 620px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-grid label:first-child,
  .field-grid label:last-child {
    padding-left: 0;
    padding-right: 0;
    border-left: 0;
  }

  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-button {
    width: 100%;
  }
}

