:root {
  --bg: #f4f2ec;
  --surface: #fbfaf7;
  --ink: #171a18;
  --muted: #676c67;
  --line: #d9d8d1;
  --accent: #315f55;
  --accent-soft: #dfe9e5;
  --max: 1180px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a { color: inherit; }

.site-header,
main,
.site-footer {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .14em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-nav a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.contact-nav { color: var(--accent) !important; font-weight: 750; }

.hero {
  width: 100%;
  max-width: none;
  padding: 24px 0 28px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  width: 100%;
  max-width: none;
  padding: 12px 16px 14px;
  border: 1px solid rgba(49, 95, 85, 0.50);
  border-radius: 12px;
  line-height: 1.04;
  text-align: center;
}

.title-line-main {
  display: block;
  white-space: nowrap;
  color: var(--ink);
  font-size: clamp(31px, 2.9vw, 42px);
  font-weight: 700;
  letter-spacing: -.038em;
}

.keep-together {
  white-space: nowrap;
}

.title-line-ai {
  display: block;
  margin-top: 5px;
  color: var(--accent);
  font-size: clamp(26px, 2.25vw, 33px);
  font-weight: 650;
  letter-spacing: -.03em;
}

.hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 16px;
}

.hero-copy {
  margin: 0;
  max-width: 740px;
  color: var(--muted);
  font-size: 14px;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.button-primary { background: var(--ink); color: white; }
.button-secondary { border: 1px solid var(--line); background: transparent; }

.section {
  padding: 30px 0 34px;
  border-top: 1px solid var(--line);
}

.section-title-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 34px;
  align-items: start;
  margin-bottom: 18px;
}

.section-title-row .section-kicker { padding-top: 7px; }

.section h2 {
  margin: 0;
  font-size: clamp(25px, 2.8vw, 36px);
  line-height: 1.08;
  letter-spacing: -.033em;
  font-weight: 625;
}

.what-section { padding-top: 28px; padding-bottom: 30px; }

.what-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.what-grid article {
  padding: 18px 18px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.32);
}

.what-grid h3 {
  margin: 0 0 5px;
  font-size: 19px;
  letter-spacing: -.02em;
}

.what-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.project-card {
  display: grid;
  grid-template-columns: 39% 61%;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.project-visual {
  display: block;
  min-height: 240px;
  overflow: hidden;
  background: #eef1ef;
  border-right: 1px solid var(--line);
}

.project-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: contain;
  object-position: center center;
  background: #eef1ef;
}

.project-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 19px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.project-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
}

.project-content h3,
.mini-card h3 {
  margin: 0 0 7px;
  font-size: 19px;
  line-height: 1.14;
  letter-spacing: -.022em;
}

.project-content p,
.mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mini-card .private-note {
  margin-top: 24px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.project-content .tech-stack,
.mini-card .tech-stack {
  margin-top: 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.live-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  margin-top: 24px;
  padding: 7px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.live-link:hover {
  background: var(--accent-soft);
}

.live-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.portfolio-section {
  padding-top: 18px;
}

.portfolio-group {
  padding: 20px 0 24px;
}

.portfolio-group + .portfolio-group {
  border-top: 1px solid var(--line);
}

.portfolio-heading {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 34px;
  align-items: start;
  margin-bottom: 15px;
}

.portfolio-heading .section-kicker { padding-top: 6px; }

.portfolio-heading h2 {
  font-size: 24px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mini-card {
  display: grid;
  grid-template-columns: 36% 64%;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.personal-tool-card {
  color: inherit;
}

.personal-tool-card:hover h3 {
  color: var(--accent);
}

.mini-card-visual {
  display: block;
}

.mini-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 168px;
  object-fit: contain;
  object-position: center center;
  background: #eef1ef;
  border-right: 1px solid var(--line);
}

.mini-card-body {
  align-self: center;
  padding: 16px;
}

.placeholder-card {
  background: var(--surface);
}

.placeholder-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  background: #eef1ef;
  border-right: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.placeholder-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}

.placeholder-title {
  font-size: 13px;
  font-weight: 700;
}

.note-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-style: dashed;
}

.placeholder-note {
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.site-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.site-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 900px) {
  .title-line-main { white-space: normal; }
  .what-grid,
  .live-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .hero-bottom { align-items: flex-start; }
}

@media (max-width: 680px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, var(--max));
  }

  .top-nav a:not(.contact-nav) { display: none; }

  .hero { padding: 20px 0 24px; }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section {
    padding: 26px 0 30px;
  }

  .section-title-row,
  .portfolio-heading {
    grid-template-columns: 1fr;
    gap: 3px;
  }

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

  .project-visual,
  .project-visual img {
    min-height: 190px;
  }

  .mini-card img,
  .placeholder-box { min-height: 170px; }
}
