/* onev.cat — dossier / directory style (dark-first, premium hacker)
   No Tailwind. Typography + spacing + micro texture.
*/

:root {
  --bg: #0a0a0a;
  --panel: rgba(255, 255, 255, 0.02);
  --text: #e5e5e5;
  --dim: #8a8a8a;
  --faint: #666666;
  --border: #222222;
  --shadow: rgba(0, 0, 0, 0.75);

  --primary: #cf6c6c;
  --primary-rgb: 207, 108, 108;
  --ambient-top: rgba(207, 108, 108, 0.09);
  --ambient-bottom: rgba(0, 0, 0, 0.18);
  --veil-top: rgba(255, 255, 255, 0.03);
  --veil-bottom: rgba(0, 0, 0, 0.14);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f0ea;
  --panel: rgba(24, 22, 18, 0.04);
  --text: #161a20;
  --dim: #434a54;
  --faint: #6b737e;
  --border: rgba(22, 26, 32, 0.12);
  --shadow: rgba(25, 18, 10, 0.12);

  --primary: #8e2a2a;
  --primary-rgb: 142, 42, 42;
  --ambient-top: rgba(142, 42, 42, 0.06);
  --ambient-bottom: rgba(95, 80, 56, 0.045);
  --veil-top: rgba(255, 255, 255, 0.24);
  --veil-bottom: rgba(72, 58, 36, 0.06);

  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

::selection { background: var(--primary); color: #000; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }

/* subtle noise overlay */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

/* container */
.shell {
  width: 100%;
  max-width: 720px;
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, transparent 0px, transparent calc(100% - 220px), var(--ambient-bottom) 100%);
  position: relative;
  box-shadow: 0 30px 80px var(--shadow);
  display: flex;
  flex-direction: column;
}
.shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 360px;
  pointer-events: none;
  background: radial-gradient(140% 58% at 50% -18%, var(--ambient-top) 0%, transparent 68%);
}
.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--veil-top) 0px,
    transparent 170px,
    transparent calc(100% - 140px),
    var(--veil-bottom) 100%
  );
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.topbar .controls {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.controls .group { display: flex; gap: 8px; align-items: center; }
.controls .sep { width: 1px; height: 12px; background: var(--border); opacity: 0.9; }

.ctrl {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ctrl:hover { color: var(--primary); }
.ctrl[aria-current="page"],
.ctrl.is-active { color: var(--primary); font-weight: 700; }

.hero {
  --hero-title-size: 46px;
  padding: 64px 24px 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.heroTitle {
  display: flex;
  align-items: center;
  gap: 14px;
}

.heroAvatar {
  width: var(--hero-title-size);
  height: var(--hero-title-size);
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex: 0 0 auto;
}

.prompt {
  font-family: var(--font-mono);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}
.prompt .left { color: var(--faint); opacity: 0.85; }
.prompt .cmd { font-weight: 700; }

.cursor {
  width: 10px;
  height: 18px;
  background: var(--primary);
  display: inline-block;
  margin-left: 6px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.h1 {
  margin: 0;
  font-weight: 700;
  font-size: var(--hero-title-size);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lede {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--dim);
  max-width: 56ch;
}

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.flag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
}

.flag .k { color: var(--primary); }
.flag .v { border-bottom: 1px solid transparent; }
.snsValues {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.valueLink {
  color: var(--faint);
  border-bottom: 1px solid transparent;
  text-decoration: none;
}
.valueLink:hover {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.proof {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.proof .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  opacity: 0.9;
}

.sectionHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 48px 24px 12px;
}

.sectionHead h2 {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

.sectionHead .hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  opacity: 0.35;
  user-select: none;
}

.tabsBlock {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.tabBar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  position: relative;
  --tab-active-x: 0px;
  --tab-active-y: 0px;
  --tab-active-w: 0px;
  --tab-active-h: 0px;
}
.tabBar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--tab-active-w);
  height: var(--tab-active-h);
  transform: translate(var(--tab-active-x), var(--tab-active-y));
  background: rgba(var(--primary-rgb), 0.08);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.15, 1), width 280ms cubic-bezier(0.2, 0.7, 0.15, 1), height 280ms cubic-bezier(0.2, 0.7, 0.15, 1), opacity 180ms ease;
}
.tabBar::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--tab-active-w);
  height: 2px;
  transform: translate(var(--tab-active-x), calc(var(--tab-active-y) + var(--tab-active-h) - 1px));
  background: var(--primary);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.15, 1), width 280ms cubic-bezier(0.2, 0.7, 0.15, 1), opacity 180ms ease;
}
.tabBar[data-indicator-ready="true"]::before {
  opacity: 1;
}
.tabBar[data-indicator-ready="true"]::after {
  opacity: 1;
}

.tabBtn {
  border: 0;
  border-right: 0;
  background: transparent;
  color: var(--faint);
  padding: 14px 10px 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color 180ms ease;
}

.tabBtn:hover { color: var(--text); }
.tabBtn.is-active {
  color: var(--text);
}

.tabPanel[hidden] { display: none; }
.tabPanel { padding-top: 2px; }
.tabSectionHead {
  padding: 16px 24px 10px;
}
.tabSectionHead h2 {
  padding-bottom: 6px;
  border-bottom: 0;
}
.writingSectionHead {
  padding-top: 14px;
}
.writingSectionHead h2 {
  opacity: 0.85;
}

.tabEmpty {
  padding: 26px 24px 34px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.list { display: flex; flex-direction: column; }

.project {
  position: relative;
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
  transition: background-color 240ms ease;
}
.project:hover { background: var(--panel); }

.project::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 220ms ease;
}
.project:hover::before { transform: scaleY(1); }

.projectGrid {
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.projectMain { flex: 1; min-width: 0; }

.projectTitleRow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.emoji {
  font-size: 18px;
  filter: grayscale(1);
  transition: filter 240ms ease;
}
.project:hover .emoji { filter: grayscale(0); }

:root[data-theme="light"] .emoji {
  filter: none;
}

.projectTitle {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  transition: color 180ms ease;
}
.project:hover .projectTitle { color: var(--primary); }

.projectDesc {
  margin: 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  max-width: 64ch;
}
.projectDesc :global(p) { margin: 0; }

.projectLinks {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  opacity: 0.65;
  transition: opacity 200ms ease;
}
.project:hover .projectLinks { opacity: 1; }
.projectLinks a:hover { color: var(--text); }

.projectMeta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  justify-content: flex-start;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  opacity: 0.55;
  white-space: nowrap;
  transition: opacity 200ms ease;
}
.project:hover .projectMeta { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  .project:is(.is-scroll-focus, .is-edge-focus) { background: var(--panel); }
  .project:is(.is-scroll-focus, .is-edge-focus)::before { transform: scaleY(1); }
  .project:is(.is-scroll-focus, .is-edge-focus) .emoji { filter: grayscale(0); }
  .project:is(.is-scroll-focus, .is-edge-focus) .projectTitle { color: var(--primary); }
  .project:is(.is-scroll-focus, .is-edge-focus) .projectLinks { opacity: 1; }
  .project:is(.is-scroll-focus, .is-edge-focus) .projectMeta { opacity: 1; }
}

.badge {
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-md);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--faint);
}

.footer {
  margin-top: auto;
  padding: 40px 24px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

.online {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.online .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2bee5b;
  box-shadow: 0 0 0 0 rgba(43, 238, 91, 0.0);
  position: relative;
}
.online .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #2bee5b;
  opacity: 0.45;
  animation: ping 1.6s ease-out infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(2.4); opacity: 0; }
}

.mutedHover {
  opacity: 0.4;
  transition: opacity 220ms ease;
}
.mutedHover:hover { opacity: 1; }

@media (max-width: 520px) {
  .hero {
    --hero-title-size: 38px;
    padding-top: 54px;
  }
  .heroTitle { gap: 10px; }
  .tabBar { padding: 0 8px; }
  .tabBtn { font-size: 10px; letter-spacing: 0.08em; }
  .projectGrid { flex-direction: column; }
  .projectMeta { align-items: flex-start; flex-direction: row; gap: 10px; text-align: left; }
}
