/* ==========================================================================
   hemingweb.com - Modern Design System & Base Styles
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Theme tokens using light-dark() */
  --bg-page: light-dark(#f8fafc, #000000);
  --surface-glass: light-dark(rgba(255, 255, 255, 0.68), rgba(18, 22, 28, 0.58));
  --surface-glass-solid: light-dark(#ffffff, #12161c);
  --surface-border: light-dark(rgba(15, 23, 42, 0.08), rgba(255, 255, 255, 0.14));
  --surface-border-hover: light-dark(rgba(13, 148, 136, 0.35), rgba(28, 180, 149, 0.35));
  --surface-subtle: light-dark(rgba(15, 23, 42, 0.03), rgba(255, 255, 255, 0.05));
  
  --text-primary: light-dark(#0f172a, #ffffff);
  --text-muted: light-dark(#475569, rgba(255, 255, 255, 0.75));
  --text-dim: light-dark(#64748b, rgba(255, 255, 255, 0.5));

  /* Unified Accent Palette (Teal / Emerald) */
  --accent-teal: light-dark(#0d9488, #1cb495);
  --accent-teal-hover: light-dark(#0f766e, #1fcaa7);
  --accent-teal-subtle: light-dark(rgba(13, 148, 136, 0.1), rgba(28, 180, 149, 0.15));

  --shadow-sm: light-dark(0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.3));
  --shadow-md: light-dark(0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 12px 32px -4px rgba(0, 0, 0, 0.45));
  --shadow-lg: light-dark(0 16px 36px -6px rgba(15, 23, 42, 0.12), 0 20px 48px -8px rgba(0, 0, 0, 0.6));

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* Explicit overrides mapped from <meta name="color-scheme"> */
:root:has(> head > meta[name="color-scheme"][content="dark"]),
html[data-theme="dark"] {
  color-scheme: dark;
}

:root:has(> head > meta[name="color-scheme"][content="light"]),
html[data-theme="light"] {
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Modern Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-page);
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* --------------------------------------------------------------------------
   Layout Containers
   -------------------------------------------------------------------------- */
.main-content {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

.content-wrapper {
  width: 100%;
  max-width: 780px;
}

.wide-wrapper {
  width: 100%;
  max-width: 1080px;
}

/* --------------------------------------------------------------------------
   Glassmorphism Cards
   -------------------------------------------------------------------------- */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

@media (max-width: 640px) {
  .main-content {
    padding: 5.5rem 1rem 3rem;
  }
  .glass-card {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 380px) {
  .main-content {
    padding: 5rem 0.65rem 2.5rem;
  }
  .glass-card {
    padding: 1.25rem 0.65rem;
  }
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin-bottom: 0.5rem;
}

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

h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

/* Unified Link Styling - All Teal, zero blue conflict */
a {
  color: var(--accent-teal);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
}

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

/* --------------------------------------------------------------------------
   Badges, Pills & Tech Stack
   -------------------------------------------------------------------------- */
.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 2rem;
  list-style: none;
}

.tech-pills li, .pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

.tech-pills a {
  color: inherit;
  border-bottom: none;
}

.tech-pills li:hover, .pill:hover {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  background: var(--accent-teal-subtle);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--accent-teal-subtle);
  color: var(--accent-teal);
  border: 1px solid var(--surface-border);
}

.badge.external {
  background: var(--surface-subtle);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Buttons & Form Controls
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
}

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

.btn-primary:hover {
  background: var(--accent-teal-hover);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-subtle);
  color: var(--text-primary);
  border-color: var(--surface-border);
}

.btn-secondary:hover {
  background: var(--surface-glass-solid);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-teal);
  background: var(--surface-glass);
  box-shadow: 0 0 0 3px var(--accent-teal-subtle);
}

/* --------------------------------------------------------------------------
   Project Grid (For Projects Page & Hubs)
   -------------------------------------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
  width: 100%;
}

@media (max-width: 680px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-md);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.project-card h3 {
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
  font-size: 0.85rem;
}

.project-link-action {
  color: var(--accent-teal);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.project-link-action:hover {
  color: var(--accent-teal-hover);
}

/* --------------------------------------------------------------------------
   Experience & Credentials Timeline/List
   -------------------------------------------------------------------------- */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.experience-item {
  padding: 1.15rem 1.25rem;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.experience-item:hover {
  border-color: var(--surface-border-hover);
  background: var(--surface-glass);
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.experience-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.experience-company {
  color: var(--accent-teal);
  font-weight: 500;
}

.experience-date {
  font-size: 0.825rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.experience-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.highlight-box {
  padding: 1rem 1.15rem;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.highlight-box:hover {
  border-color: var(--surface-border-hover);
}

.highlight-box .box-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-teal);
  margin-bottom: 0.35rem;
}

.highlight-box .box-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Contact Icons
   -------------------------------------------------------------------------- */
.social-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 1.5rem 0 0.5rem;
  padding: 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-full);
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.social-links a:hover {
  background: var(--accent-teal-subtle);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  transform: translateY(-2px);
}

.social-links svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--surface-border);
  background: var(--surface-subtle);
}

.site-footer a {
  color: var(--accent-teal);
}

.site-footer a:hover {
  color: var(--accent-teal-hover);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.footer-credits {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-credits li + li::before {
  content: "•";
  margin-right: 1rem;
  color: var(--text-dim);
}
