/* ==========================================================================
   Ryan Jeffords — Minimalistic Modern Personal Website
   ========================================================================== */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-subtle: #f3f2ef;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: rgba(29, 78, 216, 0.08);
  --btn-primary-bg: #111827;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #1f2937;
  --hero-bg: #f1efe9;
  --toggle-bg: rgba(255, 255, 255, 0.78);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 14px 36px -12px rgba(17, 24, 39, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --container: 1080px;
  --transition: 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0c0e12;
  --surface: #14171f;
  --surface-subtle: #1b1f29;
  --text: #f3f4f6;
  --text-secondary: #b4bcc8;
  --text-muted: #8b95a5;
  --border: #232834;
  --border-strong: #32394a;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --btn-primary-bg: #f3f4f6;
  --btn-primary-text: #0c0e12;
  --btn-primary-hover: #ffffff;
  --hero-bg: #11141c;
  --toggle-bg: rgba(20, 23, 31, 0.76);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 18px 40px -14px rgba(0, 0, 0, 0.55);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Inline Link */
.inline-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.inline-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Floating Theme Switcher (No Sticky Header) */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background-color: var(--toggle-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background-color var(--transition), transform var(--transition);
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

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

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(560px, 76vh, 780px);
  padding: clamp(64px, 8vw, 108px) 0 clamp(76px, 9vw, 120px);
  background-color: var(--hero-bg);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition), border-color var(--transition);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  align-items: center;
  gap: clamp(36px, 6vw, 80px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 5px 12px;
  border-radius: 999px;
  background-color: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.5rem, 5.5vw, 3.85rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--text);
}

.hero-subtitle {
  margin: 0 0 18px;
  font-size: clamp(1.125rem, 2.1vw, 1.35rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero-lead {
  margin: 0 0 32px;
  max-width: 52ch;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Core Competencies */
.competencies {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.competencies-label {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.competencies-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.competencies-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.competencies-list svg {
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.9;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.925rem;
  font-weight: 500;
  line-height: 1;
  transition: transform var(--transition), background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid transparent;
}

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

.btn-secondary {
  background-color: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background-color: var(--surface);
}

/* Portrait */
.hero-media {
  display: flex;
  justify-content: flex-end;
}

.portrait-frame {
  margin: 0;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-strong) 80%, transparent);
  box-shadow: var(--shadow-md);
  background-color: var(--surface-subtle);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Highlights Strip */
.highlights {
  position: relative;
  z-index: 2;
  margin-top: -28px;
  padding: 0 0 clamp(44px, 6vw, 72px);
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background-color: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.highlight-item {
  background-color: var(--surface);
  padding: 22px 24px;
}

.highlight-item dt {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.highlight-value {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

/* Sections */
.section {
  padding: clamp(52px, 7vw, 88px) 0;
  border-top: 1px solid var(--border);
}

.section-layout {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.section-label {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.section-aside h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text);
}

/* About Prose */
.prose {
  max-width: 66ch;
}

.prose p {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 1.025rem;
  line-height: 1.75;
}

.prose p:last-of-type {
  margin-bottom: 0;
}

.prose-lead {
  font-size: 1.15rem !important;
  line-height: 1.65 !important;
  color: var(--text) !important;
  font-weight: 450;
}

.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.interest-tag {
  padding: 5px 12px;
  border-radius: 999px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Connect */
.connect-intro {
  margin: 0 0 28px;
  max-width: 60ch;
  font-size: 1.025rem;
  line-height: 1.72;
  color: var(--text-secondary);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 640px;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.social-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.social-card-featured {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: var(--surface-subtle);
  color: var(--text);
}

.social-card-featured .social-icon {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.social-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.social-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.badge {
  padding: 2px 7px;
  border-radius: 999px;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.social-handle {
  font-size: 0.825rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
}

.social-card:hover .social-arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 44px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-sig {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-sig strong {
  color: var(--text);
  font-weight: 600;
}

.copyright {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .highlights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .social-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
    padding: 64px 0 56px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-media {
    order: -1;
    justify-content: flex-start;
  }

  .portrait-frame {
    max-width: 300px;
    border-radius: 18px;
  }

  .highlights {
    margin-top: 0;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }

  .competencies-list {
    grid-template-columns: 1fr;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
