:root {
  --bg:           #FAFAFA;
  --surface:      #FFFFFF;
  --surface-2:    #F4F4F5;
  --surface-3:    #FAFAFA;
  --ink:          #0A0A0A;
  --ink-2:        #525252;
  --ink-3:        #A3A3A3;
  --ink-4:        #D4D4D4;
  --border:       rgba(10, 10, 10, 0.08);
  --border-2:     rgba(10, 10, 10, 0.14);

  --accent:       #4F46E5;
  --accent-soft:  rgba(79, 70, 229, 0.08);
  --accent-hover: #4338CA;

  --green:        #10B981;
  --red:          #EF4444;
  --amber:        #D97706;

  --gradient-1:   rgba(79, 70, 229, 0.08);
  --gradient-2:   rgba(79, 70, 229, 0.05);

  --inverted-surface: #0A0A0A;
  --inverted-ink:     #FFFFFF;

  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

  --radius-lg:    20px;
  --radius:       12px;
  --radius-sm:    8px;

  --shadow-sm:    0 1px 2px rgba(10, 10, 10, 0.04), 0 0 0 1px rgba(10, 10, 10, 0.04);
  --shadow:       0 4px 16px rgba(10, 10, 10, 0.06), 0 0 0 1px rgba(10, 10, 10, 0.06);
  --shadow-lg:    0 14px 40px rgba(10, 10, 10, 0.10), 0 0 0 1px rgba(10, 10, 10, 0.06);
}

[data-theme="dark"] {
  --bg:           #0B0D12;
  --surface:      #14171D;
  --surface-2:    #1A1E26;
  --surface-3:    #11141A;
  --ink:          #F4F5F7;
  --ink-2:        #B8BCC4;
  --ink-3:        #6E7480;
  --ink-4:        #3A3F49;
  --border:       rgba(255, 255, 255, 0.08);
  --border-2:     rgba(255, 255, 255, 0.16);

  --accent:       #818CF8;
  --accent-soft:  rgba(129, 140, 248, 0.14);
  --accent-hover: #A5B4FC;

  --gradient-1:   rgba(129, 140, 248, 0.10);
  --gradient-2:   rgba(129, 140, 248, 0.06);

  --inverted-surface: #FAFAFA;
  --inverted-ink:     #0A0A0A;

  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.30), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow:       0 4px 16px rgba(0, 0, 0, 0.30), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-lg:    0 14px 40px rgba(0, 0, 0, 0.40), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background-image:
    radial-gradient(circle at 20% 0%, var(--gradient-1), transparent 45%),
    radial-gradient(circle at 80% 100%, var(--gradient-2), transparent 55%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

::selection { background: var(--accent-soft); color: var(--ink); }

.hub {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 56px;
}

.logo {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 38px;
  height: 38px;
  background: var(--inverted-surface);
  border-radius: 10px;
  justify-content: center;
  transition: transform .15s ease;
}
.logo:hover { transform: scale(1.04); }
.logo-letter {
  font-family: var(--font);
  font-weight: 700;
  font-size: 20px;
  color: var(--inverted-ink);
  line-height: 1;
  letter-spacing: -0.05em;
}
.logo-dot {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.brand {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
  display: inline-block;
}

.hero {
  margin-bottom: 64px;
}

.hero-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 14px;
}

.hero-sub {
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
  max-width: 520px;
}

.projects {
  margin-bottom: 56px;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  cursor: pointer;
}
a.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-2);
}

.project-name {
  font-family: var(--font);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.2;
}

.project-desc {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 12px;
  letter-spacing: -0.003em;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.005em;
}
.project-link .arrow {
  transition: transform .18s ease;
}
a.project-card:hover .project-link {
  color: var(--accent);
}
a.project-card:hover .project-link .arrow {
  transform: translateX(3px);
}

.gate-block {
  margin-bottom: 56px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.gate-block details {
  border-radius: var(--radius);
}
.gate-block details[open] .chevron {
  transform: rotate(180deg);
}

.gate-summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
}
.gate-summary::-webkit-details-marker { display: none; }
.gate-summary .section-label {
  margin: 0;
}
.gate-summary .chevron {
  font-size: 12px;
  color: var(--ink-3);
  transition: transform .18s ease;
}
.gate-summary:hover .section-label,
.gate-summary:hover .chevron {
  color: var(--ink);
}

.gate {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  max-width: 480px;
}

.gate-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.gate-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  letter-spacing: -0.005em;
}
.gate-input::placeholder {
  color: var(--ink-3);
  font-weight: 400;
}
.gate-input:hover {
  border-color: var(--ink-3);
}
.gate-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gate-btn {
  background: var(--inverted-surface);
  color: var(--inverted-ink);
  border: 1px solid var(--inverted-surface);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity .15s ease, transform .15s ease;
  white-space: nowrap;
}
.gate-btn:hover { opacity: 0.85; }
.gate-btn:active { transform: scale(0.98); }
.gate-btn:disabled { opacity: 0.5; cursor: wait; }
.gate-btn .arrow { font-size: 13px; transition: transform .15s ease; }
.gate-btn:hover .arrow { transform: translateX(3px); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.theme-toggle:hover {
  border-color: var(--border-2);
  color: var(--ink);
  transform: scale(1.04);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
}
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.top-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.gate-status {
  margin: 4px 0 0;
  min-height: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.gate-status.is-loading { color: var(--ink-2); }
.gate-status.is-error   { color: var(--red); }
.gate-status.is-ok      { color: var(--green); }

.foot {
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.foot-link {
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  padding-bottom: 1px;
}
.foot-link:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

.foot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.dot { color: var(--ink-4); font-size: 11px; }

[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity .6s cubic-bezier(.2, .7, .2, 1),
    transform .6s cubic-bezier(.2, .7, .2, 1);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal].is-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

@media (max-width: 520px) {
  .hub { padding: 20px 14px 28px; }
  .top { margin-bottom: 36px; }
  .hero { margin-bottom: 44px; }
  .hero-title { font-size: 34px; }
  .hero-sub { font-size: 15px; }
  .projects { margin-bottom: 36px; }
  .project-card { padding: 18px 20px; }
  .gate-block { margin-bottom: 36px; padding-top: 22px; }
  .gate-row { flex-direction: column; }
  .gate-btn { justify-content: center; padding: 12px 18px; }
  .foot { padding-top: 22px; }
}
