/* The student desk in the FlowCoder themes (dark and light). Loads nothing (system font stacks only); the CSP allows
   this origin only. Tokens and shared pieces follow the Q&A helper's page (app/public/style.css). */

/* ---- Themes ----
   Dark is the default and the fallback. The light theme applies when the device prefers light and the page has no
   data-theme="dark", or when data-theme="light" (the 화면 밝기 button, for this page view only). */

:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --surface: #17191d;
  --border: #24262b;
  --text: #f2f3f4;
  --muted: #9aa0a8;
  --accent: #00e5a0;
  --accent-hover: #33eab3;
  --accent-text: #00e5a0;
  --accent-graphic: #00e5a0;
  --on-accent: #0b0c0e;
  --control-line: #666c75;
  --focus: #00e5a0;
  --fill-quiet: #24262b;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #fafaf9;
    --border: #e4e5e4;
    --text: #131417;
    --muted: #5f646b;
    --accent-hover: #00b37d;
    --accent-text: #00754f;
    --accent-graphic: #00b37d;
    --control-line: #7e838b;
    --focus: #131417;
    --fill-quiet: #f1f2f1;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #fafaf9;
  --border: #e4e5e4;
  --text: #131417;
  --muted: #5f646b;
  --accent-hover: #00b37d;
  --accent-text: #00754f;
  --accent-graphic: #00b37d;
  --control-line: #7e838b;
  --focus: #131417;
  --fill-quiet: #f1f2f1;
}

/* Each logo is in the page twice; only the variant for the theme on screen is shown (and announced). */
.on-dark {
  display: block;
}

.on-light {
  display: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .on-dark {
    display: none;
  }

  :root:not([data-theme="dark"]) .on-light {
    display: block;
  }
}

:root[data-theme="light"] .on-dark {
  display: none;
}

:root[data-theme="light"] .on-light {
  display: block;
}

/* ---- Base ---- */

:root {
  --font-text: "Geist", "Pretendard", "Pretendard Variable", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 24px;
  --page: 912px;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

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

/* ---- Frame ---- */

.app {
  --inline: max(var(--gutter), calc((100% - var(--page)) / 2));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  --logo-h: 32px;
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 0 var(--inline);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.logo img {
  width: auto;
}

/* The logo files are used as supplied. The negative margin only lines the drawn F up with the text edge below. */
.logo-lockup img {
  height: var(--logo-h);
  margin-left: calc(var(--logo-h) * -0.226);
}

.header-pills {
  display: flex;
  flex: none;
  gap: 8px;
  margin-left: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.pill:hover {
  color: var(--text);
  border-color: var(--muted);
}

.app-main {
  flex: 1 0 auto;
  padding: 0 var(--inline) 96px;
}

/* ---- Shared pieces ---- */

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.rule {
  width: 56px;
  height: 3px;
  background: var(--accent-graphic);
}

.button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  min-height: 52px;
  padding: 0 24px;
  color: var(--on-accent);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  transition: background-color 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline-color: var(--text);
}

.button-secondary {
  color: var(--text);
  font-weight: 600;
  background: transparent;
  border-color: var(--control-line);
}

.button-secondary:hover {
  background: var(--fill-quiet);
  border-color: var(--control-line);
}

.button-secondary:focus-visible {
  outline-color: var(--focus);
}

/* ---- Hero ---- */

.hero {
  padding: 64px 0 40px;
}

.hero-title {
  margin: 14px 0 0;
  font-size: clamp(36px, 7vw, 60px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
  text-wrap: balance;
}

.hero .rule {
  margin-top: 28px;
}

/* ---- The two tools: on the page itself, between hairlines ---- */

.doors {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.door {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.door-text {
  min-width: 0;
}

.door-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.door-desc {
  margin: 6px 0 0;
}

.door-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  .hero {
    padding-top: 48px;
  }

  .door {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
}

@media (max-width: 360px) {
  :root {
    --gutter: 16px;
  }

  .app-header {
    --logo-h: 24px;
  }

  .header-pills {
    gap: 6px;
  }

  .pill {
    padding: 0 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ---- Footer band ---- */

.site-footer {
  flex: none;
  padding: 72px var(--inline) 56px;
  text-align: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.footer-logo img {
  height: 29px;
}

.footer-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.footer-lead,
.footer-perk,
.footer-tag,
.footer-legal p {
  text-wrap: balance;
}

.footer-lead {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.footer-lead span {
  display: block;
}

.site-footer .rule {
  margin: 34px auto;
}

.footer-label {
  margin: 0;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
}

.footer-perk {
  margin: 8px 0 0;
  line-height: 1.8;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 20px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 19px;
  text-underline-offset: 4px;
}

.footer-email:hover {
  color: var(--accent-text);
}

.footer-tag {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-legal {
  margin-top: 44px;
  padding-top: 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  border-top: 1px solid var(--border);
}

.footer-legal p {
  margin: 0;
}
