/* paulhaddad.com — Apple-Native Craft Stylesheet
 * Zero dependencies · Automatic Light & Dark mode · Print-ready Resume
 */

:root {
  color-scheme: light dark;

  --bg: hsl(240, 14%, 96%);
  --surface: hsl(0, 0%, 100%);
  --surface-translucent: hsla(0, 0%, 100%, 0.78);
  --surface-subtle: hsl(240, 10%, 98%);
  --fg: hsl(240, 4%, 12%);
  --muted: hsl(240, 2%, 33%);
  --subtle: hsl(240, 2%, 44%);
  --border: hsla(0, 0%, 0%, 0.08);
  --border-hover: hsla(0, 0%, 0%, 0.16);
  --pill: hsla(0, 0%, 0%, 0.05);
  --pill-hover: hsla(0, 0%, 0%, 0.09);
  --accent: hsl(210, 100%, 40%);
  --accent-hover: hsl(210, 100%, 34%);
  --accent-soft: hsla(210, 100%, 40%, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.035), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.05), 0 14px 32px rgba(0, 0, 0, 0.075);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --seg-active-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-xl: 18px;
  --radius-lg: 15px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --max-w: 920px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(220, 12%, 5%);
    --surface: hsl(220, 11%, 10%);
    --surface-translucent: hsla(220, 11%, 10%, 0.78);
    --surface-subtle: hsl(220, 10%, 12%);
    --fg: hsl(240, 14%, 96%);
    --muted: hsl(240, 4%, 67%);
    --subtle: hsl(240, 3%, 54%);
    --border: hsla(0, 0%, 100%, 0.09);
    --border-hover: hsla(0, 0%, 100%, 0.18);
    --pill: hsla(0, 0%, 100%, 0.08);
    --pill-hover: hsla(0, 0%, 100%, 0.14);
    --accent: hsl(212, 100%, 64%);
    --accent-hover: hsl(212, 100%, 71%);
    --accent-soft: hsla(212, 100%, 64%, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.45), 0 16px 36px rgba(0, 0, 0, 0.4);
    --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --seg-active-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 160ms ease, color 160ms ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms ease, opacity 140ms ease;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==================== STICKY TOP NAVIGATION ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-translucent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.brand:hover {
  color: var(--fg);
  opacity: 0.85;
}

.brand-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.segmented-nav {
  display: inline-flex;
  align-items: center;
  background: var(--pill);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 2px;
}

.segmented-nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: var(--radius-sm);
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.segmented-nav a:hover {
  color: var(--fg);
}

.segmented-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--seg-active-shadow);
}

/* ==================== MAIN CONTAINER ==================== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 36px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow), var(--inset-highlight);
}

/* ==================== HERO ==================== */
.hero {
  padding: 36px 34px;
}

.hero-kicker {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.8vw, 44px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--fg);
  max-width: 18ch;
}

.hero-lead {
  margin: 0 0 26px;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 64ch;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background: var(--pill);
  color: var(--fg);
}

.btn-secondary:hover {
  background: var(--pill-hover);
  color: var(--fg);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 500;
}

.social-link:hover {
  color: var(--fg);
}

/* ==================== SECTION HEADERS ==================== */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 2px;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--subtle);
}

/* ==================== FEATURED APPS GRID ==================== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: var(--fg);
  box-shadow: var(--shadow), var(--inset-highlight);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.app-card:hover {
  color: var(--fg);
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover), var(--inset-highlight);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.app-icon-img {
  width: 52px;
  height: 52px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.app-icon-img--calcbot {
  transform: scale(1.05);
}

.app-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.app-arrow {
  color: var(--subtle);
  font-size: 13px;
  transition: transform 140ms ease, color 140ms ease;
}

.app-card:hover .app-arrow {
  color: var(--accent);
  transform: translate(2px, -1px);
}

.app-platforms {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--subtle);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--pill);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.app-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* ==================== IN DEVELOPMENT + EARLIER WORK ==================== */
.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.compact-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 12px;
}

.compact-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.compact-row:first-child {
  border-top: 0;
  padding-top: 4px;
}

.compact-row:last-child {
  padding-bottom: 0;
}

.compact-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}

.compact-title a {
  color: var(--fg);
}

.compact-title a:hover {
  color: var(--accent);
}

.compact-desc {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.compact-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--subtle);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==================== ERA STRIP ==================== */
.eras-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.era-item h3 {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.era-item p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ==================== RESUME LAYOUT ==================== */
.resume-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.resume-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 78px;
}

.resume-card {
  padding: 24px;
}

.resume-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.resume-role {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.sidebar-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-label {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.contact-list a {
  color: var(--muted);
}

.contact-list a:hover {
  color: var(--accent);
}

.skill-group {
  margin-bottom: 14px;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 7px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--pill);
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.resume-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.resume-summary-card {
  padding: 24px 26px;
}

.resume-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.resume-summary-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.resume-summary-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.65;
}

.exp-card {
  padding: 24px 26px;
}

.exp-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.exp-company {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.exp-role {
  margin: 2px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
}

.exp-summary {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.exp-bullets {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.62;
}

.exp-bullets li {
  margin-bottom: 6px;
}

.exp-bullets li:last-child {
  margin-bottom: 0;
}

.exp-bullets strong {
  color: var(--fg);
  font-weight: 600;
}

/* ==================== FOOTER ==================== */
.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 44px;
}

.footer-inner {
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--subtle);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: var(--subtle);
}

.footer-links a:hover {
  color: var(--fg);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 780px) {
  .resume-layout {
    grid-template-columns: 1fr;
  }
  .resume-sidebar {
    position: static;
  }
  .apps-grid,
  .split-grid,
  .eras-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .header-inner {
    padding: 10px 16px;
  }
  .container {
    padding: 24px 16px 52px;
    gap: 28px;
  }
  .hero,
  .card,
  .exp-card,
  .resume-card,
  .resume-summary-card {
    padding: 22px 20px;
  }
  .site-footer {
    padding: 0 16px 36px;
  }
}

/* ==================== PRINT STYLESHEET (RESUME PDF) ==================== */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --fg: #111111;
    --muted: #333333;
    --subtle: #555555;
    --border: #d4d4d8;
    --pill: #f4f4f5;
    --accent: #111111;
    --shadow: none;
    --inset-highlight: none;
  }

  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
    gap: 14px;
  }

  .resume-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .resume-sidebar {
    position: static;
    gap: 10px;
  }

  .card,
  .resume-card,
  .resume-summary-card,
  .exp-card {
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    padding: 0 0 12px;
    border-bottom: 1px solid #d4d4d8;
    break-inside: avoid;
  }

  .exp-card:last-child {
    border-bottom: 0;
  }

  .contact-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 16px;
  }

  .tag {
    border: 1px solid #d4d4d8;
    background: transparent;
    padding: 2px 6px;
    font-size: 9pt;
  }

  a {
    color: #111111 !important;
  }
}
