:root {
  --eggshell: #f5f0e6;
  --eggshell-strong: #fffaf0;
  --ink: #222429;
  --ink-soft: #3a3d44;
  --line: rgba(34, 36, 41, 0.14);
  --blue: #0b70ff;
  --blue-deep: #074eb6;
  --blue-soft: rgba(11, 112, 255, 0.12);
  --surface: rgba(255, 250, 240, 0.84);
  --shadow: 0 24px 70px rgba(34, 36, 41, 0.16);
  --topbar-height: 74px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--eggshell);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(245, 240, 230, 0.72), var(--eggshell) 620px),
    url("assets/portfolio-backdrop.png") top center / min(1680px, 160vw) auto no-repeat,
    var(--eggshell);
}

body.drawer-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--eggshell-strong);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  height: var(--topbar-height);
  padding: 0 clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 230, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(11, 112, 255, 0.65);
  background:
    linear-gradient(135deg, var(--blue), transparent 58%),
    var(--ink);
  box-shadow: 0 0 0 6px var(--blue-soft);
}

.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 650;
}

.topnav a {
  position: relative;
  padding: 8px 0;
}

.topnav a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  background: var(--blue);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.topnav a:hover::after,
.topnav a:focus-visible::after {
  transform: scaleX(1);
}

.top-action,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  font-weight: 760;
}

.top-action,
.primary-button {
  background: var(--ink);
  color: var(--eggshell-strong);
}

.secondary-button {
  border-color: rgba(34, 36, 41, 0.24);
  background: rgba(255, 250, 240, 0.68);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.menu-button {
  gap: 5px;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.toolbar {
  position: fixed;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  z-index: 11;
  width: min(330px, calc(100vw - 28px));
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(34, 36, 41, 0.96);
  color: var(--eggshell-strong);
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform 220ms ease;
}

.toolbar.open {
  transform: translateX(0);
}

.toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.toolbar-header p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.close-button {
  border-color: rgba(255, 250, 240, 0.2);
  background: rgba(255, 250, 240, 0.08);
  color: var(--eggshell-strong);
}

.close-button span {
  position: absolute;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.close-button span:first-child {
  transform: rotate(45deg);
}

.close-button span:last-child {
  transform: rotate(-45deg);
}

.search-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 0.82rem;
  font-weight: 740;
}

.search-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  padding: 0 13px;
  background: rgba(255, 250, 240, 0.08);
  color: var(--eggshell-strong);
  outline: none;
}

.search-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 112, 255, 0.24);
}

.filter-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.filter-button {
  min-height: 40px;
  border: 1px solid rgba(255, 250, 240, 0.18);
  background: rgba(255, 250, 240, 0.06);
  color: var(--eggshell-strong);
  cursor: pointer;
}

.filter-button.active,
.filter-button:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.toolbar-panel {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 250, 240, 0.16);
}

.panel-label,
.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 840;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.toolbar-panel strong {
  display: block;
  font-size: 1.4rem;
}

.toolbar-panel p {
  margin: 10px 0 0;
  color: rgba(255, 250, 240, 0.72);
  line-height: 1.55;
}

.scrim {
  position: fixed;
  inset: var(--topbar-height) 0 0;
  z-index: 10;
  background: rgba(34, 36, 41, 0.42);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  min-height: calc(100svh - var(--topbar-height));
  align-items: center;
  padding: clamp(46px, 8vw, 92px) 0 clamp(40px, 6vw, 76px);
}

.hero-content {
  width: min(720px, 100%);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 22px;
  font-size: clamp(3.1rem, 8vw, 6.9rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy {
  width: min(620px, 100%);
  margin-bottom: 28px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-intro,
.about-section,
.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
  gap: 28px;
  align-items: end;
  padding: 74px 0 28px;
  border-top: 1px solid var(--line);
}

.section-intro p,
.about-section p {
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-sections {
  display: grid;
  gap: 52px;
  padding-bottom: 78px;
}

.project-section {
  display: grid;
  gap: 18px;
}

.project-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.project-section-heading h3 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1;
}

.project-section-heading .eyebrow {
  margin-bottom: 0;
}

.project-card {
  position: relative;
  min-height: 288px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(34, 36, 41, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover,
.project-card:focus-within {
  border-color: rgba(11, 112, 255, 0.5);
  box-shadow: 0 22px 70px rgba(34, 36, 41, 0.14);
  transform: translateY(-4px);
}

.project-visual {
  display: grid;
  height: 118px;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(11, 112, 255, 0.22), rgba(255, 250, 240, 0.1)),
    var(--card-color, var(--ink));
}

.project-visual span {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 250, 240, 0.7);
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.82), transparent 54%),
    rgba(11, 112, 255, 0.64);
  box-shadow: 0 0 0 14px rgba(255, 250, 240, 0.1);
}

.project-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 0.76rem;
  font-weight: 820;
}

.project-card h3 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: 0;
}

.project-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 38px;
  color: var(--ink);
  font-weight: 820;
}

.project-link::after {
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed rgba(34, 36, 41, 0.28);
  color: var(--ink-soft);
}

.about-section {
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  align-items: start;
  padding-bottom: 72px;
}

.about-photo {
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 54px rgba(34, 36, 41, 0.12);
}

.about-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 38%;
}

.about-copy {
  max-width: 700px;
}

.about-copy h2 {
  margin-bottom: 22px;
}

.about-copy p + p {
  margin-top: 18px;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  align-items: start;
  gap: clamp(24px, 5vw, 64px);
  padding-bottom: 96px;
}

.contact-section h2 {
  max-width: 620px;
  margin-bottom: 24px;
}

.contact-intro p:last-child {
  max-width: 500px;
  margin-bottom: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.contact-form {
  display: grid;
  gap: 12px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid rgba(34, 36, 41, 0.12);
  background: rgba(210, 212, 214, 0.78);
  box-shadow: 0 18px 54px rgba(34, 36, 41, 0.12);
}

.business-sheet {
  border-radius: 4px;
}

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

.contact-form label {
  display: grid;
  gap: 5px;
}

.contact-form span {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: none;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(34, 36, 41, 0.08);
  border-radius: 4px;
  background: rgba(169, 171, 174, 0.78);
  color: var(--ink);
  outline: none;
}

.contact-form input {
  min-height: 34px;
  padding: 0 10px;
}

.contact-form textarea {
  min-height: 176px;
  resize: vertical;
  padding: 10px;
  line-height: 1.5;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(34, 36, 41, 0.4);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--blue);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: 0 0 0 3px rgba(11, 112, 255, 0.14);
}

.form-submit {
  width: 100%;
  margin-top: 4px;
  cursor: pointer;
}

.form-result {
  display: grid;
  min-height: 100svh;
  align-content: center;
  gap: 18px;
}

.form-result h1 {
  margin-bottom: 0;
}

.form-result p {
  max-width: 620px;
  color: var(--ink-soft);
  line-height: 1.65;
}

:focus-visible {
  outline: 3px solid rgba(11, 112, 255, 0.55);
  outline-offset: 3px;
}

@media (min-width: 1180px) {
  body.toolbar-pinned main {
    transform: translateX(72px);
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .topnav {
    display: none;
  }

  .top-action {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 76px;
  }

  h1 {
    max-width: 9ch;
  }

  .section-intro,
  .about-section,
  .contact-section {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .about-photo {
    position: static;
    width: min(420px, 100%);
  }

  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 610px) {
  :root {
    --topbar-height: 66px;
  }

  body {
    background-size: 1180px auto;
    background-position: top right 28%;
  }

  main {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    gap: 12px;
    padding-inline: 12px;
  }

  .brand-text {
    max-width: 42vw;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 4.8rem);
  }

  .hero-copy {
    font-size: 1rem;
  }

  .hero-actions,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .contact-form {
    gap: 10px;
  }

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

  .tile-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-card {
    min-height: 0;
  }
}
