/* ============================================
   CV Static Site Styles
   Converted from Next.js + Tailwind to Semantic CSS
   ============================================ */

/* ============================================
   Font Face Declarations
   ============================================ */
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 300;
  font-display: optional;
  src: url("fonts/readex-pro-latin-300-normal.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url("fonts/readex-pro-latin-700-normal.woff2") format("woff2");
  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;
}

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  /* Colors - Light Mode */
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(0, 0%, 0%);
  --border: hsl(214.3, 31.8%, 91.4%);
  --radius: 0.5rem;

  /* Text opacity variants */
  --text-muted-1: hsl(0, 0%, 0%, 0.6);
  --text-muted-2: hsl(0, 0%, 0%, 0.7);
  --text-muted-3: hsl(0, 0%, 0%, 0.8);
  --text-primary: hsl(0, 0%, 0%, 0.9);
  --text-separator: hsl(0, 0%, 0%, 0.25);

  /* Highlight colors */
  --highlight-emerald: rgba(209, 250, 229, 0.85);

  /* Emerald accent colors */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-700: #047857;
  --emerald-800: #065f46;

  /* Slate colors */
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Avatar shadow */
  --avatar-shadow: hsl(217, 91%, 60%, 0.1);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --background: hsl(0, 0%, 6%);
    --foreground: hsl(0, 0%, 95%);
    --border: hsl(217, 20%, 20%);

    /* Text opacity variants */
    --text-muted-1: hsl(0, 0%, 95%, 0.6);
    --text-muted-2: hsl(0, 0%, 95%, 0.7);
    --text-muted-3: hsl(0, 0%, 95%, 0.8);
    --text-primary: hsl(0, 0%, 95%, 0.9);
    --text-separator: hsl(0, 0%, 95%, 0.25);

    /* Highlight colors - darker emerald for dark mode */
    --highlight-emerald: rgba(4, 120, 87, 0.4);

    /* Emerald accent colors - adjusted for dark mode */
    --emerald-50: #064e3b;
    --emerald-100: #065f46;
    --emerald-200: #047857;
    --emerald-700: #34d399;
    --emerald-800: #6ee7b7;

    /* Slate colors - adjusted for dark mode */
    --slate-400: #64748b;
    --slate-500: #94a3b8;
    --slate-700: #cbd5e1;
    --slate-800: #e2e8f0;
    --slate-900: #f1f5f9;
    --slate-950: #f8fafc;

    /* Avatar shadow */
    --avatar-shadow: hsl(217, 91%, 60%, 0.2);
  }
}

/* ============================================
   Base Styles & Typography
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Readex Pro", sans-serif;
  font-weight: 300;
  background: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.011em;
  /* Advanced OpenType features */
  font-feature-settings:
    "kern" 1,
    "liga" 1,
    "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color-scheme: light dark;
}

/* Heading hierarchy - man page style */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-feature-settings:
    "kern" 1,
    "liga" 1,
    "calt" 1;
  text-wrap: balance;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h1 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

h4 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Paragraph refinements */
p {
  text-wrap: pretty;
  hanging-punctuation: first last;
  line-height: 1.6;
}

/* Link styles */
a {
  color: var(--slate-700);
  text-decoration: none;
  transition: color 200ms ease;
  font-feature-settings:
    "kern" 1,
    "liga" 1;
}

a:hover {
  color: var(--slate-950);
}

/* Keyboard focus visibility */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--background),
    0 0 0 4px var(--slate-500);
  border-radius: 0.25rem;
}

/* List styles */
ul {
  list-style: none;
}

/* Address styles */
address {
  font-style: normal;
}

/* ============================================
   Layout Components
   ============================================ */
.cv-container {
  position: relative;
  margin: 0 auto;
  min-height: 100vh;
  padding: 1rem;
  overflow: auto;
}

@media (min-width: 768px) {
  .cv-container {
    padding: 4rem;
  }
}

.cv-content {
  margin: 0 auto;
  width: 100%;
  max-width: 42rem;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .cv-content {
    padding: 2rem;
  }
}

/* ============================================
   Header Components
   ============================================ */
.cv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.heading-display {
  font-size: 1rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
  font-feature-settings:
    "kern" 1,
    "liga" 1,
    "calt" 1;
  line-height: 1.1;
}

.pronunciation {
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.025em;
  color: var(--text-muted-1);
}

.location {
  max-width: 28rem;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-muted-2);
}

.location-inner {
  display: inline-flex;
  gap: 0.5rem;
  align-items: baseline;
  line-height: 1.375;
}

/* Contact Links (Screen Only) */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.25rem;
  padding-top: 0.25rem;
  font-size: 1rem;
  color: var(--text-muted-2);
}

.contact-link {
  display: inline-flex;
  border-radius: 0.25rem;
  padding: 0.125rem 0.125rem;
  color: var(--slate-700);
  transition: color 200ms ease;
}

.contact-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.contact-link--highlight {
  position: relative;
  background-image: linear-gradient(
    var(--highlight-emerald),
    var(--highlight-emerald)
  );
  background-position: 0 100%;
  background-size: 100% 40%;
  background-repeat: no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.contact-separator {
  color: var(--text-separator);
}

/* Print Contact */
.print-contact {
  display: none;
  gap: 0.5rem;
  color: var(--text-muted-3);
}

.print-contact a {
  text-decoration: underline;
}

/* Avatar */
.avatar-wrapper {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .avatar-wrapper {
    display: flex;
  }
}

.cv-avatar {
  width: 7rem;
  height: 7rem;
  border-radius: 9999px;
  box-shadow: 0 0 0 2px var(--avatar-shadow);
  object-fit: cover;
}

/* ============================================
   Section Components
   ============================================ */
.cv-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.heading-section {
  font-size: 1rem;
  letter-spacing: -0.014em;
  font-weight: 700;
  text-wrap: balance;
  font-feature-settings:
    "kern" 1,
    "liga" 1;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.section-content {
  color: var(--text-primary);
}

/* Body text styling */
.body-text {
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: -0.014em;
  text-wrap: pretty;
  max-width: 80ch;
  font-feature-settings:
    "kern" 1,
    "liga" 1,
    "calt" 1;
}

/* ============================================
   Skills Components
   ============================================ */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0;
  list-style: none;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid var(--emerald-200);
  background: var(--emerald-50);
  padding: 0.125rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.025em;
  color: var(--emerald-700);
  white-space: nowrap;
}

/* ============================================
   Work Experience Components
   ============================================ */
.work-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.work-item {
  border-radius: var(--radius);
  background: var(--background);
  padding: 0.25rem 0;
  page-break-inside: avoid;
  break-inside: avoid;
}

.work-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.25rem;
}

.work-title {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.014em;
  flex-wrap: wrap;
}

.company-link {
  color: var(--slate-700);
  transition: color 200ms ease;
}

.company-link:hover {
  color: var(--slate-950);
}

.work-period {
  font-variant: small-caps;
  letter-spacing: 0.03em;
  font-weight: 300;
  font-feature-settings:
    "smcp" 1,
    "c2sc" 1,
    "kern" 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 1rem;
  color: var(--text-muted-2);
}

.work-content {
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: -0.011em;
  color: var(--text-primary);
  text-wrap: pretty;
}

.work-content p {
  margin: 0;
}

/* ============================================
   Accent Underline Utility
   ============================================ */
.accent-underline {
  position: relative;
  display: inline;
  background-image: linear-gradient(
    var(--highlight-emerald),
    var(--highlight-emerald)
  );
  background-position: 0 100%;
  background-size: 100% 40%;
  background-repeat: no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.accent-underline--emerald {
  background-image: linear-gradient(
    var(--highlight-emerald),
    var(--highlight-emerald)
  );
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  @page {
    size: A4;
    margin: 1.5cm 1cm;
  }

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

  body {
    background: white !important;
    color: black !important;
    font-size: 10pt;
    line-height: 1.4;
    font-feature-settings:
      "kern" 1,
      "liga" 1,
      "tnum" 1;
  }

  h1 {
    font-size: 10pt;
    margin-bottom: 4pt;
    letter-spacing: -0.02em;
    font-weight: 700;
  }

  h2 {
    font-size: 10pt;
    margin-bottom: 3pt;
    letter-spacing: -0.01em;
    font-weight: 700;
  }

  h3 {
    font-size: 10pt;
    margin-bottom: 2pt;
    letter-spacing: -0.005em;
    font-weight: 700;
  }

  /* Prevent page breaks inside important elements */
  article,
  .work-item {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  header {
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-after: avoid;
    break-after: avoid;
  }

  section {
    page-break-inside: auto;
    break-inside: auto;
  }

  h2 {
    page-break-after: avoid;
    break-after: avoid;
    orphans: 3;
  }

  /* Prevent orphans and widows */
  p,
  li {
    orphans: 3;
    widows: 3;
  }

  /* Keep headings with content */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Don't show URLs for links */
  a::after {
    content: none !important;
  }

  /* Hide contact links, show print contact */
  .contact-links {
    display: none !important;
  }

  .print-contact {
    display: flex !important;
    font-size: 9pt;
  }

  /* Hide avatar on print */
  .avatar-wrapper {
    display: none !important;
  }

  /* Optimize spacing for print */
  .cv-container {
    padding: 0 !important;
  }

  .cv-content {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .cv-section {
    gap: 0.125rem;
  }

  .work-feed {
    gap: 0.25rem;
  }

  .work-item {
    padding: 0;
  }

  .work-header {
    gap: 0.125rem;
  }

  .work-title {
    font-size: 10pt;
  }

  .work-period {
    font-size: 9pt;
  }

  .work-content {
    margin-top: 0.125rem;
    font-size: 9pt;
    line-height: 1.4;
  }

  .body-text {
    font-size: 10pt;
    line-height: 1.4;
  }

  .skill-badge {
    font-size: 9pt;
    padding: 0.125rem 0.5rem;
  }

  .skills-list {
    gap: 0.25rem;
  }

  /* Make sure avatar prints well if visible */
  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}
