/* C-TEC v2 — text-first, quiet minimal. No framework. */
:root {
  color-scheme: light;
  --bg: #fafaf7;
  --ink: #1c1917;
  --ink-soft: #292524;
  --muted: #78716c;
  --faint: #a8a29e;
  --line: #e7e5e4;
  --body: #57534e;
  --lede: #44403c;
  --accent: #1a5c3a;
  --accent-hover: #14492e;
  --max: 42rem;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

html.dark {
  color-scheme: dark;
  --bg: #1c1917;
  --ink: #f5f4f0;
  --ink-soft: #e7e5e4;
  --muted: #a8a29e;
  --faint: #78716c;
  --line: #33302b;
  --body: #d6d3d1;
  --lede: #e7e5e4;
  --accent: #86c9a0;
  --accent-hover: #a7dabb;
  --seg-active-ring: #7aa2ff;
}

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

/* Skip link + visible focus */
.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  z-index: 100;
  transition: top 160ms ease-out;
}

.skip:focus { top: 0.5rem; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

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

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

/* Header — small, quiet; line spans content width only */
.site-header {
  border-bottom: none;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.brand img {
  height: 2rem;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand .logo-dark { display: none; }
html.dark .brand .logo-light { display: none; }
html.dark .brand .logo-dark { display: block; }

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.25rem;
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  line-height: 1.5;
}

.nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav a[aria-current="page"] {
  color: var(--ink);
}

/* Header controls: single icon buttons, mattpalmer style */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.controls {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2px 6px;
}

.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.icon-btn:hover { color: var(--ink); }
.icon-btn:active { transform: scale(0.9); }

.icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  position: absolute;
  transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.35s;
}

.icon-btn .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
.icon-btn .icon-sun { opacity: 0; pointer-events: none; transform: rotate(-90deg) scale(0); }
html.dark .icon-btn .icon-sun { opacity: 1; pointer-events: auto; transform: rotate(0) scale(1); }
html.dark .icon-btn .icon-moon { opacity: 0; pointer-events: none; transform: rotate(90deg) scale(0); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.lang-switch .sep {
  color: var(--faint);
  font-size: 0.875rem;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: 0.5rem;
  padding: 0 0.35rem;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.lang-btn:hover { color: var(--ink); }
.lang-btn:active { transform: scale(0.9); }
.lang-btn[aria-pressed="true"] { color: var(--ink); }

/* Type */
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h2 {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--lede);
  max-width: 36rem;
  margin: 0;
}

p {
  margin: 0 0 1rem;
  max-width: 38rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover { color: var(--accent-hover); }

/* Layout rhythm */
main .wrap {
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.hero { padding-bottom: 0.5rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--ink-soft);
  color: var(--bg);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--faint);
  color: var(--ink);
}

/* Founder card */
.person-card { margin-top: 1.75rem; }

.person {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}

.avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.person p { margin: 0; }
.person .role { color: var(--muted); font-size: 0.9375rem; }

/* Plain lists — no cards */
.plain-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.plain-list > li {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.plain-list > li:last-child {
  border-bottom: 1px solid var(--line);
}

.plain-list p {
  margin: 0.25rem 0 0;
  color: var(--body);
  font-size: 1rem;
}

.plain-list p.small {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
}

.product-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  color: var(--ink);
}

.product-link > div { min-width: 0; }

section[id] { scroll-margin-top: 1rem; }

.product-link:hover h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.product-link .arrow {
  color: var(--faint);
  flex-shrink: 0;
}

.product-link:hover .arrow { color: var(--accent); }

.product-link p.small.muted {
  color: var(--muted);
}

.product-link:hover p.small.muted {
  color: var(--accent);
}

/* Product page blocks */
.product-block { margin-top: 2.5rem; }
.product-block:first-of-type { margin-top: 1.5rem; }

.product-block h2 {
  font-size: 0.8125rem;
  font-family: var(--font-body);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-block ul {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.product-block li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.product-block li:last-child { border-bottom: 1px solid var(--line); }
.product-block li p { margin: 0.25rem 0 0; color: var(--body); font-size: 1rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* Entrance — one soft rise, transform + opacity only */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.rise {
  opacity: 0;
  animation: rise 320ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rise-1 { animation-delay: 0ms; }
.rise-2 { animation-delay: 60ms; }
.rise-3 { animation-delay: 120ms; }
.rise-4 { animation-delay: 180ms; }

/* Back link */
.back {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--muted);
}

.back:hover { color: var(--ink); }

@media (max-width: 1000px) {
  .site-header .wrap { flex-wrap: wrap; row-gap: 0; padding-right: 8rem; justify-content: flex-start; }
  .header-right { flex-wrap: wrap; row-gap: 0; margin-left: 0; }
  .nav { gap: 0.5rem; }
  .nav a { padding: 0.6rem 0.15rem; }
  .brand img { height: 1.75rem; }
  .controls { top: 0.6rem; right: 0.75rem; gap: 0.15rem; padding: 2px 4px; border-radius: 12px; }
  .icon-btn { width: 1.75rem; height: 1.75rem; }
  .icon-btn svg { width: 1rem; height: 1rem; }
  .lang-btn { min-width: 2rem; min-height: 1.75rem; font-size: 0.8125rem; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  main .wrap { padding-top: 2.5rem; }
  .nav { gap: 0.875rem; font-size: 0.875rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; animation: none; }
  .icon-btn svg { transition: none; }
}
