/* ---------------------------------------------------------------
   tcp0.com — design tokens
--------------------------------------------------------------- */
:root {
  --bg: #0a0e14;
  --bg-elevated: #0f151d;
  --bg-card: #121924;
  --border: #212b38;
  --border-hover: #35455a;
  --text: #e6edf3;
  --text-dim: #93a1b0;
  --text-faint: #5c6b7d;
  --accent: #39d5c9;
  --accent-strong: #6fe9df;
  --accent-amber: #f2b134;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --radius: 10px;
  --wrap: 1080px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #04140f;
  padding: 8px 14px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* background grid */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* ---------------------------------------------------------------
   avatar (preview only)
--------------------------------------------------------------- */
.avatar-frame {
  width: 128px;
  height: 128px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hover);
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--bg-card);
}
.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(35%) contrast(1.05);
}

/* ---------------------------------------------------------------
   header / nav
--------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-hover);
  flex-shrink: 0;
  display: block;
}
.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(35%) contrast(1.05);
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand .cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--mono);
  font-size: 0.88rem;
}
.nav a {
  color: var(--text-dim);
  transition: color .15s ease;
  position: relative;
  padding: 4px 0;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--accent); }

/* nav dropdown */
.nav-item { position: relative; }
.nav-dropdown-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .15s ease;
}
.nav-dropdown-trigger:hover { color: var(--text); }
.nav-dropdown-trigger[aria-expanded="true"] { color: var(--accent); }
.nav-caret {
  font-size: 0.65em;
  transition: transform .15s ease;
  transform-origin: center;
}
.nav-dropdown-trigger[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  min-width: 130px;
  box-shadow: 0 20px 45px -14px rgba(0,0,0,0.65);
  z-index: 110;
}
.nav-dropdown-menu.open { display: flex; }
.nav-dropdown-menu a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.nav-dropdown-menu a:hover { background: var(--bg-elevated); color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

/* ---------------------------------------------------------------
   hero
--------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  padding: 88px 24px 64px;
}

.kicker {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.accent { color: var(--accent); }

.lede {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  transition: all .15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #04140f;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  border-color: var(--border-hover);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* terminal */
.terminal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6);
}
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #0d131a;
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.terminal-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.terminal-body {
  margin: 0;
  padding: 22px 20px 28px;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-dim);
  min-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-cursor {
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ip strip */
.ip-strip {
  padding: 0 24px 56px;
}
.ip-strip-inner {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.ip-label { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }
.ip-value { color: var(--accent); }
.ip-sep { color: var(--border-hover); }

/* ---------------------------------------------------------------
   sections
--------------------------------------------------------------- */
.section { padding: 96px 0; }
.section-alt { background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0) 60%); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-kicker {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin: 0 0 12px;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 16px;
  max-width: 30ch;
  letter-spacing: -0.01em;
}
.section-sub { color: var(--text-dim); margin: 0 0 40px; }

/* about */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  margin-top: 32px;
}
.about-copy p { color: var(--text-dim); margin: 0 0 18px; }
.about-copy strong { color: var(--text); }

.role-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }
.role-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.role-title { font-family: var(--mono); color: var(--accent); grid-column: 1; }
.role-org { grid-column: 2; font-weight: 600; }
.role-meta { grid-column: 2; color: var(--text-faint); font-size: 0.82rem; font-family: var(--mono); }

.community-line {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
}
.community-line strong { color: var(--text); }

/* card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .15s ease, transform .15s ease;
}
.card-link:hover, .card:has(a):hover { border-color: var(--border-hover); }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-tag {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.78rem;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card h3 { margin: 0 0 10px; font-size: 1.1rem; }
.card p { color: var(--text-dim); margin: 0; font-size: 0.94rem; }
.card-cta {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}
.card-cta-muted { color: var(--text-faint); }
.card-muted { opacity: 0.75; }

.stat-callout {
  margin-top: 40px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 20px 24px;
  background: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.stat-callout p { margin: 0; color: var(--text-dim); }
.stat-callout strong { color: var(--text); }
.stat-callout a { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); white-space: nowrap; }

/* travel stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 32px;
}
.stat {
  background: var(--bg-card);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-num, .stat-num-static {
  font-family: var(--mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-amber .stat-num { color: var(--accent-amber); }
.stat-num-row { display: flex; align-items: baseline; }
.stat-num-suffix { margin-left: 2px; }
.stat-label { color: var(--text-dim); font-size: 0.86rem; }
.stat-label small { color: var(--text-faint); }

.travel-todo {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* instagram feed */
.ig-feed-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin: 56px 0 20px;
}
.ig-feed-title {
  font-family: var(--mono);
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.ig-feed-sub { color: var(--text-dim); margin: 0; }

.ig-feed-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
}
.ig-feed {
  display: flex;
  gap: 20px;
  scroll-snap-type: x mandatory;
  width: max-content;
}
.ig-card {
  position: relative;
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 165px;
  height: 206px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: block;
}
.ig-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.ig-card:hover img { transform: scale(1.05); }
.ig-card-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.75));
  color: #fff;
  font-family: var(--mono);
  font-size: 0.7rem;
}

/* contact */
.contact-wrap { text-align: center; }
.contact-wrap .section-title { max-width: none; margin-left: auto; margin-right: auto; }
.contact-wrap .hero-ctas { justify-content: center; margin-top: 28px; }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.footer-ip .accent-ip { color: var(--accent); }

/* reveal-on-scroll */
.section, .hero { opacity: 1; }
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------
   responsive
--------------------------------------------------------------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
  }
  .nav-toggle { display: flex; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2rem; }

  .nav-item { width: 100%; }
  .nav-dropdown-trigger { width: 100%; justify-content: space-between; }
  .nav-dropdown-menu {
    display: none;
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: none;
    padding: 4px 0 0 12px;
    width: 100%;
  }
  .nav-dropdown-menu.open { display: flex; }
}

/* ---------------------------------------------------------------
   subnet reference tables
--------------------------------------------------------------- */
.page-intro {
  color: var(--text-dim);
  font-size: 1.02rem;
  max-width: 66ch;
  margin: 0 0 8px;
}
.concept-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 40px;
  margin-top: 32px;
}
.concept-grid h3 {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  margin: 0 0 8px;
}
.concept-grid p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0;
}
.diagram {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  white-space: pre;
  margin: 32px 0 0;
}
.diagram .accent { color: var(--accent); }

.table-export {
  margin: 32px 0 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.table-export a {
  color: var(--accent);
  text-decoration: none;
}
.table-export a:hover { text-decoration: underline; }

.subnet-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
  max-height: 640px;
  overflow-y: auto;
}
.subnet-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: nowrap;
}
.subnet-table th, .subnet-table td {
  padding: 10px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.subnet-table th:first-child, .subnet-table td:first-child {
  text-align: left;
  color: var(--accent);
}
.subnet-table th:last-child, .subnet-table td:last-child {
  text-align: left;
  color: var(--text-dim);
}
.subnet-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-weight: 600;
  text-align: right;
  z-index: 1;
}
.subnet-table thead th:first-child, .subnet-table thead th:last-child { text-align: left; }
.subnet-table tbody tr:hover { background: var(--bg-card); }
.subnet-table tbody tr:last-child td { border-bottom: none; }
.subnet-table tr.hl td { background: rgba(57, 213, 201, 0.08); color: var(--text); }
.subnet-table tr.hl td:first-child { color: var(--accent-strong); font-weight: 700; }

@media (max-width: 640px) {
  .concept-grid { grid-template-columns: 1fr; }
}
