:root {
  --bg: #10120f;
  --surface: #171916;
  --text: #f1f0e9;
  --muted: #a7aaa0;
  --border: #30332d;
  --accent: #d8e0e7;
  --accent-soft: #b8c5cf;
  --signal: #d8e0e7;
  --max-width: 1120px;
  --font-family: "Albert Sans", sans-serif;
  --container-inset: 24px;
  --page-padding: 24px;
  --hero-bottom-padding: 24px;
  --section-top-padding: 20px;
  --section-heading-gap: 20px;
  --work-grid-gap: 16px;
  --item-row-padding: 7px;
  --contact-top-margin: 6px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { color: var(--bg); background: var(--signal); }
img { display: block; max-width: 100%; }
button, a { font: inherit; }
a { color: inherit; }
.container { width: min(var(--max-width), calc(100% - var(--container-inset))); margin: 0 auto; }

.home main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--page-padding) 0 28px;
}

.hero { padding: 0 0 var(--hero-bottom-padding); }
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 164px;
  align-items: center;
  gap: 56px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.95;
}
.lede { margin: 12px 0 0; color: var(--muted); font-size: 1.12rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: var(--contact-top-margin); }
.contact-links a,
.contact-email {
  color: var(--muted);
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-decoration-color: #60645a;
  text-underline-offset: 4px;
  cursor: pointer;
}
.contact-links a:hover,
.contact-links a:focus-visible,
.contact-email:hover,
.contact-email:focus-visible { color: var(--accent-soft); }
.contact-email.is-copied {
  color: var(--signal);
  font-weight: 600;
  text-decoration: none;
}
.contact-email:disabled { cursor: default; opacity: 1; }
.avatar {
  width: 164px;
  height: 164px;
  margin: 0;
  border: 1px solid #484b43;
  border-radius: 50%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.03);
  box-shadow: 9px 9px 0 rgba(216, 224, 231, 0.08);
}

.home .section { padding: var(--section-top-padding) 0 0; border-top: 1px solid var(--border); }
.section-heading {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: baseline;
  gap: var(--section-heading-gap);
  margin-bottom: 28px;
}
.home .section h2,
.home .section h3 {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.025em;
}
.home .section h2 { font-size: 1.55rem; }
.home .section h3 { font-size: 1.25rem; }
.about-copy { max-width: 760px; margin: 0; color: var(--muted); font-size: 1rem; }
.work-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--work-grid-gap); }
.work-column h3 { padding-bottom: 10px; border-bottom: 1px solid var(--border); }

.list { margin: 0; padding: 0; }
.item {
  margin: 0;
  border-bottom: 1px solid var(--border);
  list-style: none;
}
.item:hover { background: rgba(255, 255, 255, 0.025); }
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 47px;
  padding: var(--item-row-padding) 2px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.item-row > span { flex: 1; min-width: 0; color: #898d83; font-size: 0.82rem; line-height: 1.35; }
.company, .item-row strong { color: var(--text); font-weight: 600; }
.item-row a { text-decoration-color: #66695f; text-underline-offset: 3px; }
.item-row a:hover, .item-row a:focus-visible { color: var(--accent-soft); }
.toggle {
  flex: 0 0 auto;
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.toggle:hover, .toggle:focus-visible, .toggle[aria-expanded="true"] { color: var(--bg); border-color: var(--signal); background: var(--signal); }
.chevron { width: 15px; height: 15px; }
.toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.item-desc {
  height: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
  opacity: 0;
}
.item-desc-inner {
  padding-right: 38px;
  padding-top: 4px;
  padding-bottom: 15px;
  padding-left: 2px;
}
.item-desc p { margin: 0 0 8px; }
.tech-line { color: #7e8278; font-size: 0.78rem; }

/* Blog and project pages */
.section { padding: 44px 0; }
.article { max-width: 720px; margin: 0 auto; }
.article h1, .project-header h1 { font-size: clamp(2.5rem, 7vw, 4.6rem); line-height: 1; letter-spacing: -0.05em; }
.article .meta, .post-meta { color: var(--muted); }
.article p { margin: 16px 0; }
.back-link { display: inline-block; margin: 24px 0; color: var(--muted); }
.project-header { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.project-icon { width: 96px; height: 96px; object-fit: contain; }
.project-description, .project-details, .project-links { margin-top: 48px; }
.link-button { display: inline-block; padding: 10px 16px; border: 1px solid var(--border); text-decoration: none; }
.post { display: block; padding: 22px 0; border-top: 1px solid var(--border); text-decoration: none; }

@media (min-width: 800px) and (max-height: 760px) {
  .home main { padding-bottom: 20px; }
  .section-heading { margin-bottom: 20px; }
  .item-row { min-height: 42px; }
}

@media (max-width: 799px) {
  .container { width: min(var(--max-width), calc(100% - var(--container-inset))); }
  .home main { display: block; }
  .hero { padding-bottom: 38px; }
  .hero-inner { grid-template-columns: 1fr 96px; gap: 24px; }
  .hero h1 { font-size: clamp(2.8rem, 13vw, 4rem); }
  .avatar { width: 96px; height: 96px; box-shadow: 6px 6px 0 rgba(216, 224, 231, 0.08); }
  .section-heading { grid-template-columns: 1fr; gap: 10px; margin-bottom: 42px; }
  .work-grid { grid-template-columns: 1fr; }
  .item-row { min-height: 54px; }
}

@media (max-width: 480px) {
  .hero-inner { grid-template-columns: 1fr; }
  .portrait-wrap { display: none; }
  .contact-links { gap: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
