:root {
  color-scheme: dark;
  --header-offset: 5.75rem;
  --bg: #0d1317;
  --panel: #121c21;
  --panel-strong: #16242a;
  --surface: rgba(209, 227, 216, 0.06);
  --border: rgba(208, 225, 215, 0.12);
  --text: #edf3ef;
  --muted: #9fb0a8;
  --accent: #8fb3a4;
  --accent-strong: #b8d2c8;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f0ea;
  --panel: #fcfbf7;
  --panel-strong: #f6f2eb;
  --surface: rgba(15, 29, 26, 0.04);
  --border: rgba(20, 37, 33, 0.1);
  --text: #17211f;
  --muted: #62706c;
  --accent: #58796c;
  --accent-strong: #3e5c52;
  --shadow: 0 24px 70px rgba(63, 83, 74, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: var(--header-offset);
  background:
    radial-gradient(circle at top, rgba(143, 179, 164, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg));
  color: var(--text);
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0.9rem clamp(1rem, 2.5vw, 2rem);
  background: rgba(13, 19, 23, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

body[data-theme="light"] .site-header {
  background: rgba(243, 240, 234, 0.88);
}

.header-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.brand-block {
  min-width: 0;
}

.brand {
  display: inline-block;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-title {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.nav-link {
  padding: 0.35rem 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-link.active {
  color: var(--text);
}

.header-controls {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 0.65rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.22rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.menu-toggle-line {
  display: block;
  width: 0.95rem;
  height: 1.5px;
  background: currentColor;
  border-radius: 999px;
}

.mobile-menu {
  display: none;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: clamp(0.9rem, 2vw, 1.5rem);
  padding: clamp(0.75rem, 2vw, 1.5rem);
  max-width: 1220px;
  margin: 0 auto;
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-group {
  display: grid;
  gap: 0.85rem;
  width: min(100%, 220px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.9rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
}

.button-primary {
  background: var(--accent);
  color: #10201c;
}

body[data-theme="light"] .button-primary {
  color: #f9f8f4;
}

.button-secondary {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.resume-column {
  display: flex;
  min-width: 0;
  justify-content: center;
}

.resume-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: calc(100vh - 9.5rem);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  box-shadow: var(--shadow);
}

.resume-preview {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 10.8rem);
  display: block;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

@media (max-width: 980px) {
  :root {
    --header-offset: 5.5rem;
  }

  .header-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-nav {
    display: none;
  }

  .header-controls {
    justify-self: end;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-menu {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-0.4rem);
    pointer-events: none;
    transition:
      max-height 220ms ease,
      opacity 180ms ease,
      transform 220ms ease;
  }

  .mobile-nav-link {
    display: block;
    padding: 0.7rem 0;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
  }

  .mobile-menu[data-open="true"] {
    max-height: 8rem;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  .action-panel {
    margin-top: 0.85rem;
  }

  .action-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 460px);
  }

  .resume-frame {
    min-height: auto;
    width: 100%;
  }

  .resume-preview {
    max-height: none;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .site-header,
  .page-shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .brand {
    font-size: 1.35rem;
  }

  .brand-title {
    font-size: 0.82rem;
  }

  .resume-frame {
    border-radius: 24px;
  }

  .action-group {
    grid-template-columns: 1fr;
    width: 100%;
  }
}
