:root {
  --bg: #111;
  --box: rgba(255,255,255,0.04);
  --box-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.10);
  --border-hover: rgba(255,255,255,0.20);
  --line: rgba(255,255,255,0.10);
  --dot: rgba(255,255,255,0.22);
  --text-1: rgba(255,255,255,0.85);
  --text-2: rgba(255,255,255,0.38);
  --text-3: rgba(255,255,255,0.18);
  --mono: 'Space Mono', monospace;
  --sans: 'Inter', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --speed: 0.25s;
  --gap: clamp(28px, 4.5vh, 48px);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100%; overflow-x: hidden; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255,255,255,0.1); color: #fff; }
:focus-visible { outline: 1px solid rgba(255,255,255,0.2); outline-offset: 2px; }


/* lines */
#lines {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#lines line { stroke: var(--line); stroke-width: 1; }
#lines circle { fill: var(--dot); }


/* layout */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4vh 5vw;
  gap: var(--gap);
}


/* boxes */
.box {
  border: 1px solid var(--border);
  background: var(--box);
}


/* logo */
.logo {
  display: block;
  margin-bottom: calc(var(--gap) * -0.5);
}

.spearhead-spin {
  transform-origin: 32px 32px;
  animation: spin 90s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* header */
.header-box {
  text-align: center;
  padding: clamp(1rem, 2.5vh, 1.8rem) clamp(1.8rem, 4.5vw, 3.5rem);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.03);
  box-shadow: 0 0 20px rgba(255,255,255,0.03), 0 0 1px rgba(255,255,255,0.08);
  outline: 1px solid rgba(255,255,255,0.08);
  outline-offset: 4px;
}

.name {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.tagline {
  font-size: clamp(0.55rem, 0.95vw, 0.72rem);
  font-weight: 300;
  color: var(--text-2);
  letter-spacing: 0.07em;
  margin-top: 0.5em;
}


/* actions */
.actions {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.action {
  font-family: var(--mono);
  font-size: clamp(0.68rem, 0.95vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-2);
  text-decoration: none;
  width: clamp(145px, 16vw, 200px);
  text-align: center;
  padding: clamp(0.7rem, 1.3vh, 1rem) 0.5rem;
  transition:
    color var(--speed) var(--ease),
    border-color var(--speed) var(--ease),
    background var(--speed) var(--ease);
}

.action:hover {
  color: var(--text-1);
  border-color: var(--border-hover);
  background: var(--box-hover);
}


/* projects */
.projects-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.2vh, 24px);
}

.toggle {
  font-family: var(--sans);
  font-size: clamp(0.55rem, 0.75vw, 0.65rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-3);
  background: var(--box);
  cursor: pointer;
  padding: 0.5em 1.4em;
  position: relative;
  z-index: 2;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.toggle:hover { color: var(--text-2); border-color: var(--border-hover); background: var(--box-hover); }


/* drawer */
.drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(82vw, 480px);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  position: relative;
  z-index: 2;
  transition:
    max-height 0.4s var(--ease),
    opacity var(--speed) var(--ease);
}

.drawer.open {
  max-height: 2400px;
  overflow-y: auto;
  opacity: 1;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.regular-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

/* cells */
.cell {
  background: var(--bg);
  padding: clamp(0.55rem, 0.9vh, 0.65rem) clamp(0.55rem, 0.8vw, 0.65rem);
  min-height: 44px;
  text-decoration: none;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1em;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}

.cell:hover { background: var(--box-hover); color: var(--text-1); }

.cell-name {
  font-family: var(--mono);
  font-size: clamp(0.5rem, 0.75vw, 0.64rem);
  font-weight: 700;
}

.cell-sub {
  font-size: clamp(0.42rem, 0.55vw, 0.48rem);
  font-weight: 300;
  color: var(--text-3);
  transition: color var(--speed) var(--ease);
}
.cell:hover .cell-sub { color: var(--text-2); }

/* labels */
.section-label {
  font-family: var(--sans);
  font-size: clamp(0.42rem, 0.55vw, 0.48rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
}

/* featured */
.cell-featured {
  padding: clamp(0.55rem, 1.1vh, 0.8rem) clamp(0.55rem, 1vw, 0.8rem);
  gap: 0.15em;
}


/* footer */
.foot {
  display: flex;
  gap: clamp(0.5rem, 1.2vw, 1rem);
}

.foot a,
.foot span {
  font-size: clamp(0.5rem, 0.7vw, 0.58rem);
  font-weight: 400;
  color: var(--text-3);
  text-decoration: none;
  letter-spacing: 0.05em;
  padding: 0.4em 1em;
  border: 1px solid var(--border);
  background: var(--box);
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.foot a:hover { color: var(--text-2); border-color: var(--border-hover); background: var(--box-hover); }


/* a11y */
@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
  .spearhead-spin { animation: none; }
}

/* ultrawide */
@media (min-width: 1800px) {
  .page { max-width: 1200px; margin: 0 auto; }
}

/* tablet */
@media (max-width: 1024px) {
  .page { padding: 4vh 6vw; }
}

/* small-tablet */
@media (max-width: 768px) {
  .page { --gap: clamp(20px, 3.5vh, 32px); }
  .regular-grid { grid-template-columns: repeat(3, 1fr); }
}

/* mobile */
@media (max-width: 560px) {
  .page {
    padding: 3vh 5vw;
    --gap: clamp(16px, 3vh, 28px);
  }
  .logo { width: 56px; height: 56px; }
  .actions { flex-direction: column; align-items: center; gap: var(--gap); }
  .action { width: 72vw; max-width: 280px; }
  .header-box { padding: 0.9rem 1.2rem; }
  .drawer { width: 90vw; }
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .regular-grid { grid-template-columns: repeat(2, 1fr); }
  .foot { flex-wrap: wrap; justify-content: center; }
}

/* small-mobile */
@media (max-width: 380px) {
  .page { padding: 2vh 4vw; --gap: clamp(12px, 2.5vh, 22px); }
  .logo { width: 48px; height: 48px; }
  .name { font-size: clamp(1rem, 5vw, 1.4rem); }
  .tagline { font-size: clamp(0.5rem, 2.5vw, 0.65rem); }
  .action { width: 80vw; font-size: 0.7rem; }
  .drawer { width: 92vw; }
  .featured-grid { grid-template-columns: 1fr; }
  .regular-grid { grid-template-columns: repeat(2, 1fr); }
  .foot a, .foot span { padding: 0.35em 0.7em; font-size: 0.5rem; }
}

/* tiny-mobile */
@media (max-width: 320px) {
  .page { padding: 2vh 3vw; --gap: clamp(8px, 2vh, 16px); }
  .logo { width: 40px; height: 40px; }
  .header-box { padding: 0.6rem 0.8rem; outline: none; }
  .action { width: 85vw; }
  .regular-grid { grid-template-columns: repeat(2, 1fr); }
}

/* landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .page {
    padding: 2vh 6vw;
    --gap: clamp(6px, 1.5vh, 14px);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
  }
  .logo { width: 32px; height: 32px; margin-bottom: 0; }
  .header-box { padding: 0.4rem 1rem; }
  .tagline { display: none; }
  .name { font-size: clamp(0.9rem, 2vw, 1.2rem); }
  .action { padding: 0.35rem 0.5rem; font-size: 0.6rem; width: auto; min-width: 120px; }
  .toggle { font-size: 0.5rem; }
}

/* short-portrait */
@media (max-height: 600px) and (orientation: portrait) {
  .page {
    padding: 1.5vh 4vw;
    --gap: clamp(8px, 2vh, 16px);
  }
  .logo { width: 40px; height: 40px; }
  .name { font-size: clamp(1rem, 2.5vw, 1.3rem); }
  .header-box { padding: 0.6rem 1.5rem; }
  .action { padding: 0.45rem 0.5rem; font-size: 0.65rem; }
  .toggle { font-size: 0.52rem; }
}

/* very-short */
@media (max-height: 500px) and (orientation: portrait) {
  .page { --gap: clamp(4px, 1.2vh, 10px); }
  .logo { width: 28px; height: 28px; }
  .header-box { padding: 0.4rem 1rem; outline: none; }
  .tagline { display: none; }
}
