:root {
    --bg: #FBFBFD;
    --ink: #14151A;
    --grey: #6B6E76;
    --card: #F5F1EC;
    --accent: #C97B63;
    --line: #E9E9F1;
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    line-height: 1.65;
  }

  h1, h2, h3 { font-family: 'Sora', sans-serif; margin: 0 0 .5em; }
  p { color: var(--grey); max-width: 60ch; margin: 0 0 1em; }
  a { color: var(--accent); text-decoration: none; }
  a:hover { text-decoration: underline; }
  .button {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    padding: .8em 1.4em;
    border-radius: 12px;
    font-weight: 600;
    margin: .3em .5em .3em 0;
    border: none;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
  }
  .button:hover { background: var(--accent); text-decoration: none; }
  .button.ghost { background: var(--card); color: var(--ink); }
  .button.ghost:hover { background: var(--accent); color: #fff; }
  .button:disabled { opacity: .6; cursor: not-allowed; }
  .button:disabled:hover { background: var(--ink); }

  header, main, footer { max-width: 900px; margin: 0 auto; padding: 0 24px; }

  nav {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 900px; margin: 0 auto; padding: 20px 24px;
    font-weight: 600;
    position: sticky; top: 0; background: var(--bg); z-index: 10;
    border-bottom: 1px solid var(--line);
  }
  nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; font-weight: 500; }
  nav a { color: var(--grey); transition: color .15s ease; }
  nav a:hover { color: var(--accent); }
  .nav-toggle {
    display: none;
    background: none; border: none; cursor: pointer;
    font-size: 1.3em; color: var(--ink); padding: 4px 8px;
  }

  header { padding-top: 60px; padding-bottom: 60px; }
  header p { font-size: 1.2em; }
  header h1 { font-size: 3em; line-height: 1.05; }

  .name-row { display: flex; align-items: stretch; gap: 20px; }
  .name-col { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
  .avatar { width: auto; height: auto; aspect-ratio: 1/1; max-width: 150px; max-height: 150px; border-radius: 50%; object-fit: cover; flex: none; align-self: stretch; }

  section { padding: 50px 24px; border-top: 1px solid var(--line); max-width: 900px; margin: 0 auto; }
  .label { color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: .8em; letter-spacing: .05em; }

  .grid { display: grid; gap: 16px; }
  .cols-2 { grid-template-columns: 1fr 1fr; }
  .cols-3 { grid-template-columns: repeat(3, 1fr); }
  .cols-4 { grid-template-columns: repeat(4, 1fr); }

  .card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
  }
  .card.tint { background: var(--card); border: none; }
  .card h3 { font-size: 1.05em; }
  .card .row { border: none; padding: 0; }
  .card p { margin: .3em 0 0; }

  .work-list, .education-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .work-list .card, .education-list .card {
    display: flex; gap: 16px; align-items: flex-start;
    transition: box-shadow .15s ease, transform .15s ease;
  }
  .work-list .card:hover, .education-list .card:hover { box-shadow: 0 6px 18px rgba(20,21,26,.08); transform: translateY(-2px); }

  .cols-3 .card { display: flex; flex-direction: column; min-height: 170px; transition: box-shadow .15s ease, transform .15s ease; }
  .cols-3 .card p { flex: 1; }
  .cols-3 .card:hover { box-shadow: 0 6px 18px rgba(20,21,26,.08); transform: translateY(-2px); }
  .logo {
    flex: none; width: 80px; height: 80px; border-radius: 10px;
    background: var(--card); color: var(--grey); font-size: .65em;
    display: flex; align-items: center; justify-content: center;
  }
  
  .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

.project-head { display: flex; align-items: center; gap: 10px; margin-bottom: .5em; }
.project-head h3 { margin: 0; }
.project-icon { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; flex: none; }

  .tag {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 0.875em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.625rem;
    margin: 0.175rem;
    border-radius: 999px;
    background: var(--accent);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--line);
    backdrop-filter: blur(6px);
}

.tag i { font-size: 0.9em; line-height: 1; }

.skill-row { display: flex; flex-wrap: wrap; }

.tag-secondary {
  background: var(--line);
  color: var(--accent)
}

.tag-green {
  background: green;
  color: #fff;
}

.tag-rust-light {
  background: #E3A88F;
  color: #5C2A15;
}

.tag-rust-dark {
  background: #9C5236;
  color: #fff;
}

.tag-tan {
  background: #D9B79E;
  color: #5C2A15;
}

.card-title {
  font-family: 'Sora';
  font-size: 14px;
}

  .icon { margin-right: 6px; }

  .project-links { display: flex; gap: 16px; margin-top: auto; padding-top: 8px; }
  .project-links a { display: inline-flex; align-items: center; color: var(--grey); font-size: 1.2em; }
  .project-links a:hover { color: var(--accent); }

  .logo-grid { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 20px; align-items: start; }
  .logo-tile { aspect-ratio: 1/1; background: #fff; border: 1px solid var(--line); }
  .logo-tile .caption {
    inset: 0; transform: none; opacity: 0;
    align-items: center; justify-content: center; text-align: center;
    background: rgba(20,21,26,.75); transition: opacity .2s ease;
    font-size: 8px;
  }
  .logo-tile:hover .caption { opacity: 1; }
  .logo-tile img { object-fit: contain; padding: 0.5px; width: 100%; height: 100%; }

  .photo { aspect-ratio: 1/1; background: var(--card); border-radius: 16px; display: flex; object-fit: contain; align-items: center; justify-content: center; color: var(--grey); position: relative; overflow: hidden; }
  .photo img { width: 100%; height: 100%; object-fit: contain; }
  .photo .caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: rgba(20,21,26,.75); color: #fff;
    padding: 10px 12px;
    transform: translateY(100%);
    transition: transform .2s ease;
    font-size: 12px;
  }
  .photo:hover .caption { transform: translateY(0); }

  dl { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; }
  dt { font-size: .75em; text-transform: uppercase; color: var(--grey); }
  dd { margin: 0; font-weight: 600; }

  .row {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    padding: 16px 0; border-top: 1px solid var(--line);
  }
  .row:first-child { border-top: none; padding-top: 0; }
  .row .meta { color: var(--grey); font-size: .9em; }
  .degree-sub { display: block; color: var(--grey); font-size: .8em; font-weight: 400; margin-top: 2px; }
  .education-list .card p { font-size: .9em; }

  .company { display: block; font-weight: 600; font-size: .85em; margin: 2px 0 6px; }

  footer { text-align: center; padding-top: 60px; padding-bottom: 90px; }
  footer h2 { font-size: 1.8em; }

  .contact-card { max-width: 480px; margin: 24px auto 0; text-align: left; }
  .contact-form { display: flex; flex-direction: column; gap: 14px; }
  .form-row { display: flex; flex-direction: column; gap: 6px; }
  .form-row label { font-size: .8em; font-weight: 600; color: var(--grey); text-transform: uppercase; letter-spacing: .03em; }
  .form-row input, .form-row textarea {
    font-family: inherit;
    font-size: 1em;
    padding: .7em .9em;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
  }
  .form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); }
  .form-row textarea { resize: vertical; }
  .contact-form .button { align-self: flex-start; margin: 0; }
  .button.accent { background: var(--accent); }
  .button.accent:hover { background: var(--ink); }
  .contact-success { color: var(--accent); font-weight: 600; margin: 0; }
  .contact-error { color: #B0413E; margin: 16px 0 0; }

  @media (max-width: 700px) {
    .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; }
    .cols-2 { grid-template-columns: 1fr; }
    .work-list, .education-list { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    nav ul {
      display: none;
      position: absolute; top: 100%; left: 0; right: 0;
      flex-direction: column; gap: 0;
      background: var(--bg); border-bottom: 1px solid var(--line);
      padding: 8px 24px 16px;
    }
    nav ul.open { display: flex; }
    nav ul li { width: 100%; }
    nav ul a { display: block; padding: 10px 0; }
    .photo .caption { transform: translateY(0); }
    .logo-tile .caption { opacity: 1; }
    .avatar { height: 64px; align-self: center; }
  }
