/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --text: #000000;
  --muted: #000000;
  --subtle: #000000;
  --line: #000000;
  --accent: #000000;
  --accent-strong: #000000;
  --accent-soft: #000000;
  --ink: #000000;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #000000;
    --surface-strong: #000000;
    --text: #ffffff;
    --muted: #ffffff;
    --subtle: #ffffff;
    --line: #ffffff;
    --accent: #ffffff;
    --accent-strong: #ffffff;
    --accent-soft: #ffffff;
    --ink: #ffffff;
    --shadow: none;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #000000;
  --surface-strong: #000000;
  --text: #ffffff;
  --muted: #ffffff;
  --subtle: #ffffff;
  --line: #ffffff;
  --accent: #ffffff;
  --accent-strong: #ffffff;
  --accent-soft: #ffffff;
  --ink: #ffffff;
  --shadow: none;
}

html[data-theme="light"],
html.pdf-export {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --text: #000000;
  --muted: #000000;
  --subtle: #000000;
  --line: #000000;
  --accent: #000000;
  --accent-strong: #000000;
  --accent-soft: #000000;
  --ink: #000000;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 28px;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-link,
.topbar-actions,
.hero-actions,
.profile-links {
  display: flex;
  align-items: center;
}

.brand-link {
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-actions a,
.theme-toggle,
.button {
  min-height: 42px;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 700;
}

.topbar-actions a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  justify-content: center;
  width: 42px;
  padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.theme-toggle__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  line-height: 1;
}

.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.theme-toggle__icon--sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle__icon--sun {
  display: inline-flex;
}

.section-block {
  margin-top: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 32px;
  align-items: stretch;
  min-height: 520px;
  padding: clamp(28px, 4.5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.project-kicker,
.detail-item span {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(2.5rem, 5.6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  max-width: 860px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.3vw, 2.1rem);
  line-height: 1.14;
  letter-spacing: 0;
}

h3 {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.25;
}

.hero-lede {
  max-width: 660px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.08rem);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.button-primary {
  background: var(--ink);
  color: var(--surface);
}

.button-primary:hover,
.button-primary:focus-visible {
  color: var(--surface);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

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

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  text-decoration: none;
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.contact-list span,
.metric-label {
  display: block;
  color: var(--subtle);
  font-size: 0.82rem;
  font-weight: 700;
}

.contact-list a,
.contact-list strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 800;
}

.contact-list strong {
  line-height: 1.35;
}

.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.metric-value {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: clamp(1.85rem, 2.8vw, 2.65rem);
  font-weight: 900;
  line-height: 1;
}

.profile-links {
  flex-wrap: wrap;
  gap: 10px;
}

.profile-links a {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.summary-grid,
.section-block:not(.hero):not(.detail-band) {
  padding: clamp(24px, 4vw, 44px) 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
  gap: 30px;
}

.prose {
  color: var(--muted);
  font-size: 1rem;
}

.prose p:last-child,
.project-card p:last-child,
.skill-group p:last-child,
.detail-item p:last-child {
  margin-bottom: 0;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  max-width: none;
}

.card-grid,
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-card,
.skill-group,
.experience-group,
.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.project-card,
.skill-group,
.detail-item {
  padding: 20px;
}

.project-card h3,
.skill-group h3,
.experience-group h3 {
  margin-bottom: 10px;
}

.project-card p,
.skill-group p,
.experience-group li,
.detail-item p {
  color: var(--muted);
}

.experience-list {
  display: grid;
  gap: 14px;
}

.experience-group {
  padding: 22px;
}

.experience-group ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.experience-group li::marker {
  color: var(--accent);
}

.detail-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.detail-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.pdf-avoid-break,
section,
article,
header,
h2,
h3,
ul {
  break-inside: avoid;
  page-break-inside: avoid;
}

html.pdf-export body {
  background: #ffffff !important;
  color: #000000 !important;
}

html.pdf-export .web-only {
  display: none !important;
}

html.pdf-export .site-shell {
  width: min(8.2in, 100%);
  padding: 0;
}

html.pdf-export .section-block {
  box-shadow: none;
}

@media (max-width: 900px) {
  .site-shell {
    width: min(100% - 24px, 720px);
    padding-top: 12px;
  }

  .topbar {
    position: static;
    align-items: flex-start;
  }

  .topbar,
  .topbar-actions {
    flex-wrap: wrap;
  }

  .hero,
  .summary-grid,
  .detail-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-card {
    order: -1;
  }

  .contact-list,
  .card-grid,
  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 18px, 560px);
  }

  .topbar {
    gap: 12px;
  }

  .brand-link {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions a,
  .theme-toggle {
    justify-content: center;
    padding: 0 10px;
  }

  .topbar-actions a {
    flex: 1 1 auto;
  }

  .theme-toggle {
    flex: 0 0 42px;
    padding: 0;
  }

  .hero {
    padding: 22px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.25rem);
  }

  .contact-list,
  .card-grid,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }
}

.site-footer {
  margin-top: 28px;
  padding: 16px 0 0;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--subtle);
  font-size: 0.82rem;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.footer-socials a:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.footer-socials svg {
  width: 18px;
  height: 18px;
}

@media print {
  html,
  body {
    height: auto !important;
    overflow: visible !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .web-only,
  .topbar,
  .hero-actions {
    display: none !important;
  }

  .site-shell {
    width: 100%;
    padding: 0;
  }

  .section-block {
    margin-top: 14px;
    border-color: #000000;
    box-shadow: none;
  }

  .hero {
    min-height: auto;
  }

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