/* =========================================================================
   Advoke CV — Base reset and element defaults
   Modern, minimal, accessibility-first.
   ========================================================================= */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  font-size: 100%;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  html {
    scroll-padding-top: calc(var(--header-height-desktop) + var(--space-6));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100dvh;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  overflow-x: hidden;
}

/* -------------------------------------------------------------------------
   Media defaults
   ------------------------------------------------------------------------- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

svg {
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Typography defaults
   ------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tighter);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

p {
  text-wrap: pretty;
  max-width: 72ch;
}

small {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

strong,
b {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

em,
i {
  font-style: italic;
}

/* -------------------------------------------------------------------------
   Lists
   ------------------------------------------------------------------------- */
ul,
ol {
  list-style: none;
}

/* -------------------------------------------------------------------------
   Links
   ------------------------------------------------------------------------- */
a {
  color: var(--text-brand);
  text-decoration: none;
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--brand-800);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
}

a:focus-visible {
  outline: none;
  border-radius: var(--radius-xs);
  box-shadow: var(--focus-ring);
}

/* -------------------------------------------------------------------------
   Buttons — reset to a clean slate
   ------------------------------------------------------------------------- */
button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: inherit;
  -webkit-appearance: none;
  appearance: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------------------
   Form elements — inherit typography, remove platform chrome
   ------------------------------------------------------------------------- */
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

select {
  cursor: pointer;
}

/* Remove number input spinners */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
}

/* Search input: remove native clear button on WebKit */
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Date input: keep the icon visible on WebKit */
input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  filter: saturate(0);
}

input[type='date']::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* -------------------------------------------------------------------------
   Fieldset / legend
   ------------------------------------------------------------------------- */
fieldset {
  border: none;
}

legend {
  padding: 0;
  font-weight: var(--weight-semibold);
}

/* -------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------- */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* -------------------------------------------------------------------------
   HR
   ------------------------------------------------------------------------- */
hr {
  border: none;
  border-top: var(--resume-rule-width, 1px) solid var(--border-subtle);
  margin: var(--space-8) 0;
}

/* -------------------------------------------------------------------------
   Code / pre
   ------------------------------------------------------------------------- */
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: var(--space-4);
  background: var(--bg-surface-sunk);
  border-radius: var(--radius-md);
}

code {
  padding: 0.15em 0.4em;
  background: var(--bg-surface-sunk);
  border-radius: var(--radius-xs);
}

pre code {
  padding: 0;
  background: none;
}

/* -------------------------------------------------------------------------
   Selection
   ------------------------------------------------------------------------- */
::selection {
  background: var(--brand-200);
  color: var(--ink-950);
}

/* -------------------------------------------------------------------------
   Focus — global fallback for any focusable element
   ------------------------------------------------------------------------- */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}

/* -------------------------------------------------------------------------
   Scrollbar — subtle, only on desktop
   ------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }

  *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  *::-webkit-scrollbar-track {
    background: transparent;
  }

  *::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
    border: 3px solid transparent;
    background-clip: content-box;
  }

  *::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
    background-clip: content-box;
  }
}

/* -------------------------------------------------------------------------
   Hidden attribute — make it actually hide
   ------------------------------------------------------------------------- */
[hidden] {
  display: none !important;
}

/* -------------------------------------------------------------------------
   Dialog reset — native <dialog> only; our modal primitive does not use it
   but guard anyway.
   ------------------------------------------------------------------------- */
dialog {
  border: none;
  padding: 0;
  background: none;
  color: inherit;
}

dialog::backdrop {
  background: var(--bg-overlay);
}

/* -------------------------------------------------------------------------
   Print — nothing on screen should print by default
   The print stylesheet narrows visibility to the resume document only.
   ------------------------------------------------------------------------- */
@media print {
  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}