/* Public careers — shadcn component shapes, brand colors via --* tokens.
   data-brand=spacecurve | migaku. Served from /static (CSP style-src 'self').
   Geist Variable is the same self-hosted face as /admin (preset bJfIo4BM). */

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/geist-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/geist-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/geist-vietnamese-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/geist-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/geist-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

:root,
[data-brand] {
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
  /* Lucide chevron-down; tinted per brand to muted-foreground at ~0.5 opacity. */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-opacity='0.5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Spacecurve: black / white / #f83860, dark default. */
[data-brand="spacecurve"] {
  --background: #000000;
  --foreground: #ffffff;
  --card: #111111;
  --card-foreground: #ffffff;
  --popover: #111111;
  --popover-foreground: #ffffff;
  --primary: #f83860;
  --primary-foreground: #ffffff;
  --secondary: #1c1c1c;
  --secondary-foreground: #ffffff;
  --muted: #1c1c1c;
  --muted-foreground: #a3a3a3;
  --accent: #1c1c1c;
  --accent-foreground: #ffffff;
  --destructive: #e07a7a;
  --border: #333333;
  --input: #333333;
  --ring: #f83860;
  --ok: #6bcf8e;
  --font: "Geist Variable", sans-serif;
  --header-bg: rgba(0, 0, 0, 0.65);
  --paper: #000000;
  --ink: #ffffff;
  --line: #333333;
  color-scheme: dark;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-opacity='0.5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Migaku: indigo board, pink primary. */
[data-brand="migaku"] {
  --background: #0a002a;
  --foreground: #ffffff;
  --card: #160a36;
  --card-foreground: #ffffff;
  --popover: #160a36;
  --popover-foreground: #ffffff;
  --primary: #fe4670;
  --primary-foreground: #ffffff;
  --secondary: #24124a;
  --secondary-foreground: #ffffff;
  --muted: #24124a;
  --muted-foreground: #c4b6e0;
  --accent: #24124a;
  --accent-foreground: #ffffff;
  --destructive: #e07a7a;
  --border: #3d2a6e;
  --input: #3d2a6e;
  --ring: #fe4670;
  --ok: #6bcf8e;
  --font: "Geist Variable", sans-serif;
  --header-bg: rgba(10, 0, 42, 0.65);
  --paper: #0a002a;
  --ink: #ffffff;
  --line: #3d2a6e;
  color-scheme: dark;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c4b6e0' stroke-opacity='0.5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
}

body {
  font-family: var(--font);
  font-synthesis: none;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[type="checkbox"]:focus-visible,
[type="radio"]:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 50%, transparent);
}

:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

button:not(:disabled),
.btn,
a[href],
select,
label[for],
summary {
  cursor: pointer;
}

/* —— Layout chrome —— */
header.app {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 0;
  border-bottom: none;
  box-shadow: none;
  background: color-mix(in srgb, var(--background) 34%, transparent);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
}

.brand-public {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  gap: 0.7rem;
  max-width: 70vw;
}

.brand-logo {
  display: block;
  height: 88px;
  width: auto;
  max-width: 70vw;
  object-fit: contain;
}

.brand-mark {
  display: block;
  height: 90px;
  width: auto;
  max-width: 70vw;
  object-fit: contain;
  border-radius: 12px;
}

@media (max-width: 346px) {
  .brand-logo,
  .brand-mark {
    height: auto;
  }
  .brand-logo {
    max-height: 88px;
  }
  .brand-mark {
    max-height: 90px;
  }
}

.brand-word {
  font-weight: 700;
  font-size: clamp(1.45rem, 5vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 1.15rem 3.5rem;
}

@media (min-width: 720px) {
  header.app {
    padding: 1rem 1.75rem;
  }
  main {
    padding: 1rem 1.75rem 4rem;
  }
}

h1,
h2,
h3,
input,
textarea,
select,
button,
.btn,
label,
.rec-shell,
.rec-actions,
.rec-fallback {
  font-family: var(--font);
}

h1 {
  font-size: clamp(1.55rem, 4.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.55rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

p {
  margin: 0 0 0.85rem;
}

.muted {
  color: var(--muted-foreground);
  font-size: 0.92rem;
}

.optional-hint {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.35rem;
}

footer {
  color: var(--muted-foreground);
  font-size: 0.8rem;
  margin-top: 1.5rem;
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav a {
  color: var(--foreground);
  text-decoration: none;
}

.nav a:hover {
  color: var(--primary);
}

.inline {
  display: inline;
  margin: 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

/* —— Card —— */
.card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--card);
  color: var(--card-foreground);
  border: 0;
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.35rem;
  margin: 0 0 1.1rem;
  box-shadow: var(--shadow-xs), 0 0 0 1px color-mix(in srgb, var(--foreground) 10%, transparent);
}

/* —— Label —— */
label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0.85rem 0 0.3rem;
  color: var(--foreground);
  user-select: none;
}

/* —— Input / textarea / select —— */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
textarea,
select {
  width: 100%;
  min-width: 0;
  height: 2.25rem;
  font: inherit;
  font-size: 1rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--input) 30%, transparent);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
  transition: color 0.15s, box-shadow 0.15s, border-color 0.15s;
}

textarea {
  min-height: 10rem;
  height: auto;
  padding: 0.5rem 0.625rem;
  resize: vertical;
}

@media (min-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  textarea,
  select {
    font-size: 0.875rem;
  }
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-color: color-mix(in srgb, var(--input) 30%, transparent);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

select::-ms-expand {
  display: none;
}

select::picker-icon {
  display: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-foreground);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 20%, transparent);
}

input[type="file"] {
  height: auto;
  padding: 0.4rem 0.5rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}

input[type="file"]::file-selector-button {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  margin-right: 0.5rem;
  padding: 0 0.5rem;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--secondary);
  color: var(--secondary-foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: color-mix(in srgb, var(--secondary) 92%, var(--foreground));
}

/* —— Checkbox / radio —— */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--input);
  background: color-mix(in srgb, var(--input) 30%, transparent);
  box-shadow: var(--shadow-xs);
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  accent-color: var(--primary);
}

input[type="checkbox"] {
  border-radius: 4px;
}

input[type="radio"] {
  border-radius: 999px;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::before {
  content: "";
  width: 0.35rem;
  height: 0.55rem;
  border: solid var(--primary-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

input[type="radio"]:checked::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--primary-foreground);
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]),
.field-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin: 0.75rem 0;
}

/* —— Buttons (shadcn variants) —— */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

button:hover,
.btn:hover {
  background: color-mix(in srgb, var(--primary) 80%, black);
}

button.secondary,
a.secondary,
.btn.secondary {
  background: var(--background);
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

button.secondary:hover,
a.secondary:hover,
.btn.secondary:hover {
  background: var(--muted);
  color: var(--foreground);
}

button.destructive,
button.danger {
  background: color-mix(in srgb, var(--destructive) 10%, transparent);
  color: var(--destructive);
  border-color: color-mix(in srgb, var(--destructive) 40%, transparent);
}

button.destructive:hover,
button.danger:hover {
  background: color-mix(in srgb, var(--destructive) 20%, transparent);
  color: var(--destructive);
}

button.ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #082012;
}

button.linkish,
.btn.link {
  background: none;
  border: 0;
  color: var(--primary);
  padding: 0;
  min-height: 0;
  box-shadow: none;
  text-underline-offset: 4px;
}

button.linkish:hover,
.btn.link:hover {
  text-decoration: underline;
  background: none;
}

button.ghost {
  background: transparent;
  color: var(--foreground);
}

button.ghost:hover {
  background: var(--muted);
}

/* —— Badge / pill —— */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge,
.pill {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.pill.open {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
}

.pill.closed {
  color: var(--destructive);
  border-color: color-mix(in srgb, var(--destructive) 40%, transparent);
  background: color-mix(in srgb, var(--destructive) 10%, transparent);
}

/* —— Alert / validation —— */
.alert,
.flash,
.error {
  position: relative;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  font-size: 0.875rem;
  text-align: left;
}

.flash {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--border));
  background: color-mix(in srgb, var(--ok) 10%, var(--card));
}

.error,
.alert-destructive {
  color: var(--destructive);
  border-color: color-mix(in srgb, var(--destructive) 40%, var(--border));
}

.field-error {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--destructive);
}

/* —— Separator —— */
.separator,
hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

/* —— Table —— */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.35rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* —— Dialog (utility; unused pages stay unobtrusive) —— */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--background) 60%, transparent);
}

.dialog {
  background: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs), 0 0 0 1px color-mix(in srgb, var(--foreground) 10%, transparent);
  padding: 1.25rem;
  max-width: 28rem;
}

/* —— Tooltip —— */
.tooltip {
  background: var(--foreground);
  color: var(--background);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* —— Skeleton / progress —— */
.skeleton {
  border-radius: var(--radius-md);
  background: var(--muted);
  animation: scd-pulse 1.4s ease-in-out infinite;
}

@keyframes scd-pulse {
  50% {
    opacity: 0.5;
  }
}

.progress {
  display: block;
  width: 100%;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}

.progress > span,
.progress-bar {
  display: block;
  height: 100%;
  background: var(--primary);
}

/* —— Job description —— */
.job-desc {
  margin: 1.1rem 0;
  font-size: 0.98rem;
  color: var(--foreground);
}

.job-desc p {
  margin: 0;
}

.job-desc h1,
.job-desc h2,
.job-desc h3 {
  margin: 1rem 0 0.4rem;
  text-transform: none;
  letter-spacing: -0.01em;
}

.job-desc ul,
.job-desc ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.job-desc a {
  color: var(--primary);
}

.job-desc img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  margin: 0 0 1rem;
}

.job-desc blockquote {
  border-left: 3px solid var(--primary);
  margin: 0.5rem 0;
  padding-left: 0.75rem;
  color: var(--muted-foreground);
}

.job-desc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--background);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

/* —— Apply recorder —— */
.rec-shell {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  margin-top: 0.5rem;
}

.rec-shell video {
  width: 100%;
  max-height: min(56vw, 360px);
  background: #000;
  border-radius: var(--radius-md);
  display: block;
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.rec-actions button {
  min-height: 44px;
  min-width: 44px;
  padding: 0.65rem 1rem;
  flex: 1 1 8.5rem;
}

.rec-fallback {
  margin-top: 0.75rem;
}

.ts-box {
  margin: 1rem 0 0;
  width: 100%;
  min-height: 65px;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
}

.copy-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  button,
  .btn {
    min-height: 44px;
  }
}
