/* BuildCV — professional, ATS-friendly frontend */

:root {
  --navy: #1e3d6b;
  --navy-deep: #0f2240;
  --navy-mid: #2a5294;
  --teal: #0f9d8e;
  --teal-dark: #0b7c71;
  --gold: #f0b429;
  --coral: #e4543c;
  --coral-dark: #c9432e;
  --paper: #eef3fa;
  --surface: #ffffff;
  --ink: #152036;
  --muted: #5a6b80;
  --line: #d5deea;
  --danger: #c24141;
  --danger-bg: #fde8e8;
  --ok: #0b7c71;
  --ok-bg: #e6f7f4;
  --shadow: 0 14px 34px rgba(15, 34, 64, 0.12);
  --radius: 14px;
  --header-h: 68px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --cv-font: Georgia, "Times New Roman", serif;
  --mono: "Cascadia Code", "Consolas", "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 460px at 8% -8%, rgba(15, 157, 142, 0.16), transparent 55%),
    radial-gradient(900px 380px at 100% 0%, rgba(228, 84, 60, 0.12), transparent 48%),
    linear-gradient(180deg, #eaf0f8 0%, #f7f4ec 100%);
  line-height: 1.5;
  min-height: 100vh;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--teal-dark);
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

.hidden {
  display: none !important;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--navy);
  color: #fff;
  padding: 8px 12px;
  z-index: 1000;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(115deg, #0f2240 0%, #1e3d6b 58%, #1a4f78 100%);
  color: #fff;
  min-height: var(--header-h);
  box-shadow: 0 8px 24px rgba(15, 34, 64, 0.28);
}

.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--teal));
}

.header-inner {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.brand-text span {
  color: var(--gold);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 9px;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  background: #fff;
  margin: 5px 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link,
.dropdown-trigger {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 8px 11px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-link:hover,
.dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-link.is-active {
  background: rgba(240, 180, 41, 0.22);
  color: var(--gold);
}

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: middle;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  z-index: 60;
}

.dropdown-menu a,
.dropdown-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover,
.dropdown-menu a:focus-visible,
.dropdown-menu button:focus-visible {
  background: #e7f6f3;
  color: var(--navy);
}

/* Views */
.view[hidden] {
  display: none !important;
}

.about-page h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--navy);
}

.panel-title {
  font-size: 1.05rem;
  margin: 0 0 14px;
  color: var(--navy);
}

.home-chooser {
  padding: 54px 0 54px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.option-card,
.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.option-card {
  --card-accent: var(--teal);
  display: flex;
  flex-direction: column;
  min-height: 420px;
  height: 100%;
  padding: 18px 18px 16px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #eaf7f4 0%, #fff 46%);
  border-top: 0;
  box-shadow:
    inset 6px 0 0 var(--card-accent),
    var(--shadow);
}

.option-card--upload { --card-accent: var(--teal); }
.option-card--scratch {
  --card-accent: var(--gold);
  background: linear-gradient(180deg, #fff7e6 0%, #fff 46%);
}
.option-card--editor {
  --card-accent: var(--coral);
  background: linear-gradient(180deg, #fdecea 0%, #fff 46%);
}

.about-card {
  padding: 20px 22px;
}

.option-card:hover,
.about-card:hover {
  transform: translateY(-6px);
  box-shadow:
    inset 6px 0 0 var(--card-accent, var(--teal)),
    0 22px 40px rgba(15, 34, 64, 0.16);
}

.about-card:hover {
  box-shadow: 0 22px 40px rgba(15, 34, 64, 0.16);
}

.option-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.option-step {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--navy);
}

.option-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 157, 142, 0.14);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 800;
}

.option-card--scratch .option-tag {
  background: rgba(240, 180, 41, 0.22);
}

.option-card--editor .option-tag {
  background: rgba(228, 84, 60, 0.16);
}

.option-card h2,
.about-card h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  line-height: 1.25;
}

.option-card > p:not(.field-error) {
  color: var(--muted);
  margin: 0 0 14px;
  font-size: 0.9rem;
  min-height: 3.2em;
}

.option-stage {
  flex: 1 1 auto;
  display: flex;
  min-height: 168px;
  margin-bottom: 14px;
}

.option-card-action {
  margin-top: auto;
  width: 100%;
  min-height: 42px;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  width: 100%;
  position: relative;
  padding: 16px 14px;
  border: 2px dashed #7db8ae;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 18%, rgba(15, 157, 142, 0.2), transparent 52%),
    linear-gradient(180deg, #f3fbf9, #ffffff);
  color: var(--navy);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.file-drop:hover,
.file-drop.is-dragover {
  border-color: var(--teal);
  border-style: solid;
  background:
    radial-gradient(circle at 50% 18%, rgba(15, 157, 142, 0.28), transparent 52%),
    linear-gradient(180deg, #e8f8f4, #fff);
  box-shadow: 0 10px 22px rgba(15, 157, 142, 0.16);
}

.file-drop.has-file {
  border-color: var(--teal);
  border-style: solid;
}

.file-drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-drop-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2ec4b2, var(--teal));
  color: #fff;
  box-shadow: 0 8px 14px rgba(15, 157, 142, 0.28);
}

.file-drop-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.file-drop-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.file-drop:hover .file-drop-cta {
  background: var(--navy-mid);
}

.file-drop-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.file-drop .file-name {
  margin: 2px 0 0;
  font-weight: 700;
  color: var(--teal-dark);
}

.cv-mini,
.editor-mini {
  position: relative;
  flex: 1;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
}

.cv-mini {
  display: flex;
  background: linear-gradient(180deg, #fff8e8, #fff);
  border: 1px solid #ead7a0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.cv-mini-accent {
  width: 10px;
  background: linear-gradient(180deg, #f6c453, #d89a14);
}

.cv-mini-body {
  flex: 1;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cv-mini-body strong {
  color: var(--navy);
  font-size: 0.92rem;
}

.cv-mini-role {
  color: var(--muted);
  font-size: 0.72rem;
}

.cv-mini-line,
.editor-mini-page i {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: #dfe6f1;
}

.cv-mini-line--short {
  width: 62%;
}

.cv-mini-body em {
  margin-top: 6px;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b8860b;
}

.cv-mini-pills {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.cv-mini-pills i {
  width: 28px;
  height: 10px;
  border-radius: 99px;
  background: rgba(240, 180, 41, 0.35);
}

.cv-mini-live {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.editor-mini {
  display: flex;
  flex-direction: column;
  background: #f4f7fb;
  border: 1px solid #d7c0b8;
}

.editor-mini-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #fff, #f3e8e4);
  border-bottom: 1px solid #e4d0c9;
}

.editor-mini-ribbon span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e4543c;
}

.editor-mini-ribbon span:nth-child(2) { background: #f0b429; }
.editor-mini-ribbon span:nth-child(3) { background: #0f9d8e; }

.editor-mini-ribbon b {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

.editor-mini-page {
  flex: 1;
  margin: 10px 14px 12px;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(15, 34, 64, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-mini-page i:first-child {
  width: 46%;
  height: 9px;
  background: rgba(228, 84, 60, 0.35);
}

.editor-mini-page i:nth-child(2) { width: 88%; }
.editor-mini-page i:nth-child(3) { width: 70%; }

.option-card:hover .cv-mini,
.option-card:hover .editor-mini {
  transform: translateY(-3px);
}

.cv-mini,
.editor-mini {
  transition: transform 0.18s ease;
}

.file-name,
.fallback-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.field-error,
.status-banner.is-error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #f3c1c1;
  padding: 8px 10px;
  border-radius: 8px;
}

.status-banner.is-ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid #b7e0d2;
  padding: 8px 10px;
  border-radius: 8px;
}

.notice {
  background: #fff8e8;
  border: 1px solid #ead7a2;
  color: #6a5416;
  padding: 10px 12px;
  border-radius: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--navy-mid), var(--navy));
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-deep);
}

.btn-accent {
  background: linear-gradient(180deg, #17b3a3, var(--teal));
  color: #fff;
}

.btn-accent:hover {
  background: var(--teal-dark);
}

.btn-ghost {
  background: #fff;
  color: var(--navy);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: #eaf2fb;
  border-color: #b9cbe0;
}

.btn-back {
  background: linear-gradient(180deg, #ff7d68, var(--coral));
  color: #fff;
  border-color: var(--coral);
  box-shadow: 0 4px 12px rgba(228, 84, 60, 0.35);
  font-weight: 700;
}

.btn-back:hover {
  background: var(--coral-dark);
}

.btn-back-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.btn-tiny {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

/* Workspace / split */
.workspace {
  padding-bottom: 48px;
}

.workspace-toolbar,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.theme-label,
.theme-custom span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #c5d0d8;
  cursor: pointer;
  padding: 0;
}

.theme-swatch.is-selected {
  box-shadow: 0 0 0 2px var(--navy);
}

.theme-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.theme-custom input[type="color"] {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.editor-panel,
.output-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
  box-shadow: var(--shadow);
}

.preview-panel {
  min-width: 0;
}

.preview-scroll {
  overflow: auto;
  max-height: calc(100vh - 180px);
  padding: 8px;
  background: linear-gradient(180deg, #c9d6ea, #e4ebf5);
  border-radius: var(--radius);
}

/* Forms */
.form-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #ffffff, #f5f8fc);
}

.form-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 600;
}

input,
textarea,
select {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  width: 100%;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.entry-card {
  border: 1px dashed #c5d0d8;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e6f4f2;
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

.chip button {
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.inline-add {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Resume preview */
.cv-paper {
  --cv-accent: #1e3d6b;
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  color: #222;
  padding: 16mm 15mm;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  font-family: var(--cv-font);
  overflow-wrap: anywhere;
  word-break: break-word;
  border-top: 8px solid var(--cv-accent);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.cv-name {
  font-size: 26px;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
  text-transform: uppercase;
  color: var(--cv-accent);
}

.cv-title {
  margin: 0 0 8px;
  color: var(--cv-accent);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-family: var(--font);
  font-size: 12px;
  color: #444;
  border-bottom: 1.5px solid var(--cv-accent);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.cv-section {
  margin-bottom: 12px;
}

.cv-section h2 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cv-accent);
  border-bottom: 1px solid var(--cv-accent);
  margin: 0 0 6px;
  padding-bottom: 3px;
  font-family: var(--font);
}

.cv-section p,
.cv-section li {
  font-size: 12.5px;
  margin: 0 0 4px;
  line-height: 1.4;
}

.cv-item {
  margin-bottom: 8px;
}

.cv-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 13px;
}

.cv-item-sub {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font);
  font-size: 12px;
  color: #555;
  font-style: italic;
}

.cv-tech {
  font-family: var(--font);
  font-size: 11.5px;
  color: #333;
}

.cv-skills,
.cv-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 6px;
}

.cv-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cv-accent) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--cv-accent) 30%, #dbe3ee);
  color: var(--cv-accent);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.cv-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 2px 0 6px;
}

.cv-lang {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 120px;
}

.cv-lang-name {
  font-weight: 700;
  font-size: 12.5px;
  color: #222;
}

.cv-lang-level {
  font-family: var(--font);
  font-size: 12px;
  color: #555;
}

@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
  .cv-tag {
    background: #eef4fb;
    border-color: #c9d7e8;
    color: #1e3d6b;
  }
}

.cv-empty {
  font-family: var(--font);
  color: var(--muted);
  text-align: center;
  padding: 40px 12px;
}

/* JSON / compiler editors */
.code-editor {
  min-height: 62vh;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow: auto;
  tab-size: 2;
}

.console-output {
  min-height: 62vh;
  margin: 0;
  padding: 12px;
  background: #10233d;
  color: #d7f3ee;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 13px;
}

.console-output .err {
  color: #ffb4b4;
}

.console-output .meta {
  color: #8aa;
}

.pdf-view {
  margin: 0;
  padding: 0;
}

.pdf-stage {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: calc(100vh - var(--header-h) - 3px - 58px);
  min-height: 60vh;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
}

.pdf-view .fallback-note {
  margin: 0;
  padding: 0 12px 8px;
}

.about-page {
  padding: 32px 0 56px;
}

.about-lead {
  font-size: 1.08rem;
  max-width: 760px;
}

.contact-highlight {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 520px;
  margin: 18px 0 8px;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e3d6b, #163056);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 34, 64, 0.2);
}

.contact-highlight-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.contact-highlight a {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
  word-break: break-word;
}

.contact-highlight a:hover {
  color: var(--gold);
}

.contact-highlight-note {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
}

.about-list {
  max-width: 760px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.site-footer {
  border-top: 0;
  padding: 20px 0;
  color: rgba(255, 255, 255, 0.78);
  background: linear-gradient(180deg, #163056, #0f2240);
}

.site-footer a {
  color: var(--gold);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 80;
  box-shadow: var(--shadow);
}

.compiler-sandbox {
  width: 0;
  height: 0;
  border: 0;
  position: absolute;
}

/* Responsive */
@media (max-width: 980px) {
  .option-grid,
  .about-grid,
  .split-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .preview-scroll {
    max-height: none;
  }

  .code-editor,
  .console-output {
    min-height: 40vh;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #10243f;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 4px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    min-width: 0;
    margin-top: 4px;
  }

  .workspace-toolbar,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

/* Print — clone the live preview (#print-root) and keep template styling intact.
   Page margins keep multi-page content off the sheet edges. */
@page {
  size: A4 portrait;
  margin: 14mm 12mm;
}

@media print {
  html,
  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.is-printing > *:not(#print-root) {
    display: none !important;
  }

  #print-root {
    /* Do not force display/background — templates depend on these. */
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }

  /* Screen paper padding is 16mm; with @page margins, use a lighter inset
     so page-1 headers still feel full-width while page-2+ keep top space. */
  #print-root.cv-paper {
    padding-top: 4mm !important;
    padding-bottom: 4mm !important;
    padding-left: 3mm !important;
    padding-right: 3mm !important;
  }

  /* Templates that already zero paper padding and pad headers/sections themselves */
  #print-root[data-template="aurora"],
  #print-root[data-template="noir"],
  #print-root[data-template="ember"],
  #print-root[data-template="meadow"],
  #print-root[data-template="prism"],
  #print-root[data-template="velvet"],
  #print-root[data-template="nova"] {
    padding: 0 !important;
  }

  #print-root,
  #print-root * {
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }

  #print-root .cv-contact,
  #print-root .cv-item-head,
  #print-root .cv-item-sub,
  #print-root .cv-skills,
  #print-root .cv-tech {
    display: flex !important;
  }

  #print-root[data-template="prism"],
  #print-root[data-template="velvet"],
  #print-root[data-template="nova"] {
    display: grid !important;
  }

  #print-root[data-template="prism"] .cv-columns,
  #print-root[data-template="velvet"] .cv-columns,
  #print-root[data-template="nova"] .cv-columns {
    display: contents !important;
  }

  #print-root .cv-section,
  #print-root .cv-item,
  #print-root .cv-skills,
  #print-root .cv-tag {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #print-root .cv-section h2 {
    break-after: avoid;
    page-break-after: avoid;
  }
}
