:root {
  --bg: #ffffff;
  --text: #000000;
  --muted: #5f6368;
  --soft: #f6f6f6;
  --border: #e6e6e6;
  --grid: rgba(0, 0, 0, .05);
  --btn-bg: #000000;
  --btn-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0b; --text: #ffffff; --muted: #a1a1a1; --soft: #161616;
    --border: #262626; --grid: rgba(255, 255, 255, .06); --btn-bg: #ffffff; --btn-text: #000000;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0b; --text: #ffffff; --muted: #a1a1a1; --soft: #161616;
  --border: #262626; --grid: rgba(255, 255, 255, .06); --btn-bg: #ffffff; --btn-text: #000000;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Poppins, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 57px); }

/* Faint grid backdrop, faded at the edges */
.grid-bg { position: relative; }
.grid-bg::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 98px 83px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

/* Buttons */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 30px; border-radius: 999px; font-weight: 500;
  border: 1px solid var(--border); background: var(--bg); transition: transform .2s, opacity .2s;
}
.pill:hover { transform: translateY(-2px); }
.pill.dark { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-bg); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: none; border: 0; color: var(--text); cursor: pointer;
}
.icon-btn.ring { width: 40px; height: 40px; border: 1px solid var(--border); }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; height: 88px; }
.logo { font-size: 28px; font-weight: 600; letter-spacing: -0.04em; }
.nav-actions { display: flex; align-items: center; gap: 14px; }

/* Hero */
.hero { padding-top: 96px; padding-bottom: 120px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 40px; }
.avatar { width: 160px; height: 125px; object-fit: cover; border-radius: 20px; background: var(--soft); }
.badge { position: relative; width: 124px; height: 124px; color: var(--muted); }
.badge svg { width: 100%; height: 100%; animation: spin 18s linear infinite; }
.badge text { font-size: 8.6px; letter-spacing: 0; fill: currentColor; font-weight: 500; }
.badge span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; opacity: .45; }
@keyframes spin { to { transform: rotate(360deg); } }
h1 { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.2; }
.hero-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 64px; align-items: start; }
.small { margin: 0 0 18px; font-size: 15px; }
.cta { display: flex; gap: 16px; flex-wrap: wrap; }
.intro { margin: 0; font-size: 18px; max-width: 490px; line-height: 1.6; }

/* Featured work */
.giant {
  font-size: clamp(56px, 12vw, 172px); font-weight: 500; letter-spacing: -0.05em;
  line-height: 1; text-align: center; margin-bottom: 72px;
}
.giant sup { font-size: .5em; vertical-align: .55em; margin-left: -.05em; }
.works { display: grid; grid-template-columns: 1fr 1fr; gap: 72px 100px; }
.work { display: flex; flex-direction: column; }
.shot {
  aspect-ratio: 5 / 4; border-radius: 20px; overflow: hidden; background: var(--soft);
  display: flex; align-items: center; justify-content: center; padding: 6%;
}
.shot img {
  width: 100%; height: auto; display: block; border-radius: 10px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); transition: transform .5s;
}
.work:hover .shot img { transform: scale(1.04); }
.work:nth-child(1) .shot { background: #e3ede8; }
.work:nth-child(2) .shot { background: #e6e6f5; }
.work:nth-child(3) .shot { background: #e2e7ef; }
:root[data-theme="dark"] .work .shot { background: var(--soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .work .shot { background: var(--soft); } }
.work-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 28px; }
.work-meta h3 { font-size: 26px; }
.work-meta span { font-size: 15px; font-weight: 500; text-align: right; }
.work p { margin: 8px 0 0; color: var(--muted); max-width: 520px; }

.oss-box {
  aspect-ratio: 5 / 4; border-radius: 20px; background: var(--soft);
  padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; gap: 24px;
}
.oss-box h3 { font-size: 34px; }
.oss-box .pill { align-self: flex-start; margin-top: auto; }
.repo-list { list-style: none; padding: 0; margin: 0; }
.repo-list li { padding: 16px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.repo-list a { font-weight: 500; font-size: 18px; }
.repo-list a:hover { text-decoration: underline; }
.repo-list span { color: var(--muted); font-size: 14px; }

/* Contact */
.contact { padding-top: 160px; padding-bottom: 80px; }
.big { font-size: clamp(40px, 5.5vw, 76px); line-height: 1.1; margin-bottom: 18px; }
.contact > .muted { font-size: 17px; max-width: 560px; margin: 0 0 48px; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.contact-card {
  display: flex; flex-direction: column; gap: 6px; padding: 40px;
  border-radius: 20px; background: var(--soft); font-size: 20px; font-weight: 500;
  transition: transform .2s; word-break: break-word;
}
.contact-card:hover { transform: translateY(-3px); }
.contact-card span { font-size: 14px; color: var(--muted); font-weight: 400; }

/* Footer */
.footer { text-align: center; padding: 100px 16px 40px; overflow: hidden; }
.footer .giant { margin-bottom: 80px; font-weight: 600; }
.footer-line { font-weight: 500; font-size: 17px; margin: 0 0 20px; }
.footer-actions { display: flex; justify-content: center; align-items: center; gap: 14px; }
.copy { margin: 28px 0 0; font-size: 15px; }

.to-top {
  position: fixed; right: 50px; bottom: 50px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

@media (max-width: 860px) {
  .hero { padding-top: 40px; padding-bottom: 72px; }
  .hero-bottom, .works, .contact-grid { grid-template-columns: 1fr; }
  .works { gap: 56px; }
  .badge { width: 96px; height: 96px; }
  .oss-box { aspect-ratio: auto; }
  .contact { padding-top: 100px; }
  .to-top { right: 16px; bottom: 16px; }
  .logo { font-size: 22px; }
  .nav .pill { padding: 10px 18px; font-size: 14px; }
}
