/* Kornerstone: design tokens and base styles shared by the site and the portal. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --line: #e8e8e5;
  --line-strong: #d4d4d0;
  --text: #0b0b0c;
  --text-2: #3f3f46;
  --muted: #63636b;
  --faint: #9a9aa0;
  --logo-sub: #9a9aa0;
  --invert-bg: #0b0b0c;
  --invert-text: #f4f4f2;
  --invert-muted: #a1a1a9;
  --invert-line: #26262b;
  --grid: rgba(11, 11, 12, 0.055);
  --shadow-sm: 0 1px 2px rgba(11, 11, 12, 0.05);
  --shadow: 0 1px 2px rgba(11, 11, 12, 0.04), 0 12px 32px -8px rgba(11, 11, 12, 0.12);
  --shadow-lg: 0 2px 4px rgba(11, 11, 12, 0.04), 0 32px 64px -16px rgba(11, 11, 12, 0.18);
  --ok: #15803d;
  --ok-bg: #e7f7ec;
  --warn: #a15c07;
  --warn-bg: #fdf3dc;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --focus: #0b0b0c;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0c;
  --bg-2: #0f0f11;
  --surface: #131315;
  --surface-2: #19191c;
  --line: #232327;
  --line-strong: #34343a;
  --text: #f4f4f2;
  --text-2: #d0d0d5;
  --muted: #a1a1a9;
  --faint: #6e6e76;
  --logo-sub: #5e5e66;
  --invert-bg: #f4f4f2;
  --invert-text: #0b0b0c;
  --invert-muted: #55555c;
  --invert-line: #dcdcd8;
  --grid: rgba(244, 244, 242, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 32px 64px -16px rgba(0, 0, 0, 0.75);
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, 0.1);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.1);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --focus: #f4f4f2;
}

:root {
  --font-display: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --container: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
  text-wrap: pretty;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection {
  background: var(--text);
  color: var(--bg);
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
}
.skip-link:focus {
  top: 12px;
}

/* Logo */
.logo {
  height: 34px;
  width: auto;
  color: var(--text);
}
.logo .logo-sub {
  fill: var(--logo-sub);
}
.mark {
  width: 22px;
  height: 22px;
  color: var(--text);
}

/* Buttons */
.btn {
  --btn-bg: var(--text);
  --btn-fg: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), opacity 0.2s var(--ease);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn:active {
  transform: translateY(0);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
  transform: none;
  box-shadow: none;
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--text);
  box-shadow: none;
}
.btn--sm {
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
}
.btn .arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* Theme toggle */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--text);
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
}
.theme-toggle .i-sun {
  display: none;
}
[data-theme="dark"] .theme-toggle .i-sun {
  display: block;
}
[data-theme="dark"] .theme-toggle .i-moon {
  display: none;
}

/* Form controls */
.field {
  display: grid;
  gap: 6px;
}
.field label,
.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--faint);
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--muted);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--grid);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%2363636b' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
}
.notice--ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.notice--error {
  background: var(--danger-bg);
  color: var(--danger);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
