:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6f6f6f;
  --line: #e9e9e9;
  --card: #f6f6f6;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: #ededed;
    --muted: #8f8f8f;
    --line: #232323;
    --card: #141414;
  }
  .card { --tint: var(--tint-d) !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 24px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.name { display: flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: -0.01em; }
.name img { width: 32px; height: 32px; }
.top nav { display: flex; gap: 28px; color: var(--muted); font-size: 15px; }
.top nav a:hover { color: var(--text); }

/* Intro */
.intro { padding-top: 96px; padding-bottom: 120px; }
.intro p {
  max-width: 920px;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.intro a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; text-decoration-color: var(--line); transition: text-decoration-color .2s; }
.intro a:hover { text-decoration-color: currentColor; }

/* Section label */
.label {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 16px; margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em;
}
.label span { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.card {
  display: flex; flex-direction: column;
  border-radius: 20px; background: var(--card);
  overflow: hidden;
  transition: transform .25s ease;
}
.card__media {
  position: relative;
  display: flex; justify-content: center; gap: 14px;
  height: 340px; padding-top: 40px;
  background: var(--tint);
  overflow: hidden;
}
.card__media img {
  width: 27%; height: auto; align-self: flex-start;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.12);
  transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.card__media img:nth-child(2) { margin-top: 24px; }
.card:hover .card__media img { transform: translateY(-8px); }
.card:hover .card__media img:nth-child(2) { transition-delay: .03s; }
.card:hover .card__media img:nth-child(3) { transition-delay: .06s; }

.card__body { display: flex; gap: 16px; padding: 24px 24px 0; }
.icon {
  flex: none; width: 56px; height: 56px; border-radius: 13px;
  box-shadow: 0 0 0 1px var(--line);
}
.card h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.card__body p { margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.45; }

.card__meta {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: auto; padding: 20px 24px 22px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.go { color: var(--text); white-space: nowrap; }

/* Contact */
.contact { padding-top: 120px; padding-bottom: 120px; }
.contact p { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; font-weight: 500; letter-spacing: -0.025em; }
.contact p a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.14em; text-decoration-color: var(--line); word-break: break-word; }
.contact p a:hover { text-decoration-color: currentColor; }

/* Footer */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  position: relative;
  padding-top: 24px; padding-bottom: 40px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.foot::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; border-top: 1px solid var(--line); }
.foot a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card__media img { transition: none; }
  .card:hover .card__media img { transform: none; }
}

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .card__media { height: 320px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .foot::before { left: 16px; right: 16px; }
  .top { height: 60px; }
  .top nav { gap: 20px; }
  .intro { padding-top: 48px; padding-bottom: 72px; }
  .grid { gap: 16px; }
  .card { border-radius: 18px; }
  .card__media { height: 250px; padding-top: 28px; gap: 10px; }
  .card__media img { width: 29%; border-radius: 12px; }
  .card__media img:nth-child(2) { margin-top: 16px; }
  .card__body { padding: 20px 20px 0; gap: 14px; }
  .icon { width: 48px; height: 48px; border-radius: 11px; }
  .card__meta { padding: 16px 20px 18px; }
  .contact { padding-top: 80px; padding-bottom: 80px; }
}

/* ===== App page ===== */
@media (prefers-color-scheme: dark) { .app { --tint: var(--tint-d) !important; } }

.back { display: inline-block; margin-top: 32px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.back:hover { color: var(--text); }

.app__head { display: flex; gap: 32px; align-items: center; padding: 40px 0 56px; }
.app__icon { flex: none; width: 128px; height: 128px; border-radius: 29px; box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0,0,0,.08); }
.app__head h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; font-weight: 600; letter-spacing: -0.035em; }
.app__short { margin-top: 10px; max-width: 640px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.45; color: var(--muted); }
.app__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.app__cta span { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 500; font-size: 15px; transition: opacity .2s;
}
.btn::after { content: "↗"; margin-left: 8px; opacity: .6; }
.btn:hover { opacity: .85; }

.gallery { background: var(--tint); padding: 48px 0; }
.gallery__track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 max(24px, calc((100vw - 1200px) / 2 + 24px));
  scroll-padding: 0 max(24px, calc((100vw - 1200px) / 2 + 24px));
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track img {
  flex: none; width: 250px; aspect-ratio: 600 / 1300; object-fit: cover;
  border-radius: 22px; scroll-snap-align: start;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.12);
}

.app__cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 64px; padding-top: 72px; }
.app__about p { max-width: 640px; font-size: 18px; line-height: 1.6; }
.app__about p + p { margin-top: 16px; }
.label--gap { margin-top: 56px; }
.features { margin: 0; padding: 0; list-style: none; max-width: 640px; }
.features li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.features li:first-child { padding-top: 0; }

.app__info dl { margin: 0; }
.app__info dl div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.app__info dl div:first-child { padding-top: 0; }
.app__info dt { color: var(--muted); }
.app__info dd { margin: 0; text-align: right; }
.legal { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font-family: var(--mono); font-size: 13px; }
.legal a { color: var(--muted); }
.legal a:hover { color: var(--text); }

.more { padding-top: 112px; padding-bottom: 96px; }
.more__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.mini { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 16px; background: var(--card); transition: background .2s; }
.mini:hover { background: var(--line); }
.mini img { width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 0 0 1px var(--line); }
.mini span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini strong { font-size: 15px; font-weight: 500; line-height: 1.3; }
.mini small { font-family: var(--mono); font-size: 12px; color: var(--muted); }

@media (max-width: 1000px) {
  .more__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini { flex-direction: row; align-items: center; padding: 14px; }
  .mini img { width: 48px; height: 48px; border-radius: 11px; }
}
@media (max-width: 860px) {
  .app__cols { grid-template-columns: 1fr; gap: 56px; }
}
@media (max-width: 560px) {
  .back { margin-top: 20px; }
  .app__head { flex-direction: column; align-items: flex-start; gap: 20px; padding: 28px 0 40px; }
  .app__icon { width: 96px; height: 96px; border-radius: 22px; }
  .btn { width: 100%; justify-content: center; }
  .gallery { padding: 32px 0; }
  .gallery__track { gap: 12px; padding: 0 16px; scroll-padding: 0 16px; }
  .gallery__track img { width: 68vw; max-width: 260px; border-radius: 18px; }
  .app__cols { padding-top: 48px; }
  .app__about p { font-size: 17px; }
  .more { padding-top: 72px; padding-bottom: 64px; }
  .more__grid { grid-template-columns: 1fr; }
}
