/*
Theme Name: David Williams CV
Theme URI: https://dphwilliams.com
Author: David Williams
Author URI: https://dphwilliams.com
Description: A one-page CV/resume theme with dark editorial aesthetic, timeline-based experience section, and scroll-triggered animations.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: david-williams-cv
*/

/* ── RESET & VARIABLES ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1114;
  --bg-card: #16181d;
  --bg-card-hover: #1c1f26;
  --text: #e8e6e1;
  --text-muted: #9a968e;
  --accent: #c9a84c;
  --accent-dim: rgba(201, 168, 76, 0.15);
  --accent-glow: rgba(201, 168, 76, 0.08);
  --border: rgba(255,255,255,0.06);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Outfit', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
  pointer-events: none;
  z-index: 9999;
}

/* ── NAV ── */
nav.cv-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px) saturate(1.5);
  background: rgba(15,17,20,0.8);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s ease;
}

nav.cv-nav .logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}

nav.cv-nav .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.cv-nav .nav-links li {
  list-style: none;
}

nav.cv-nav .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s;
}

nav.cv-nav .nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

nav.cv-nav .nav-links a:hover { color: var(--accent); }
nav.cv-nav .nav-links a:hover::after { width: 100%; }

.mobile-toggle {
  display: none;
  background: none; border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseGlow 8s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,168,76,0.04) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseGlow 10s ease-in-out infinite reverse;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 4rem;
  max-width: 1100px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-image {
  flex-shrink: 0;
  position: relative;
}

.hero-image img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 60px rgba(201,168,76,0.15), 0 20px 60px rgba(0,0,0,0.4);
  animation: fadeScaleIn 1s ease-out both;
}

.hero-image::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.2);
  animation: fadeScaleIn 1s ease-out 0.2s both;
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.hero-text h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  animation: slideUp 0.8s ease-out 0.3s both;
}

.hero-text h1 span {
  color: var(--accent);
}

.hero-text .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 1rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  animation: slideUp 0.8s ease-out 0.5s both;
}

.hero-text .hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
  animation: slideUp 0.8s ease-out 0.7s both;
}

.hero-meta a, .hero-meta span {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s;
}

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

.hero-meta svg {
  width: 16px; height: 16px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── SECTIONS ── */
.cv-section {
  padding: 5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  white-space: nowrap;
}

.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s ease;
}

.about-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201,168,76,0.15);
  transform: translateY(-2px);
}

.about-card .card-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.about-card .card-value {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.about-card .card-detail {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* ── TIMELINE ── */
.timeline {
  position: relative;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.4s ease;
}

.timeline-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201,168,76,0.15);
  transform: translateX(4px);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -3rem;
  top: 2.4rem;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: -5px;
  box-shadow: 0 0 12px rgba(201,168,76,0.4);
}

.timeline-item .role {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-item .company {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.timeline-item .dates {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  letter-spacing: 0.04em;
}

.timeline-item ul {
  list-style: none;
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
  padding: 0;
}

.timeline-item li {
  padding-left: 1.2rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.timeline-item li::before {
  content: '\203A';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* ── SKILLS / INTERESTS ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  background: var(--accent-dim);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--accent);
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 400;
  transition: all 0.3s;
}

.tag:hover {
  background: rgba(201,168,76,0.25);
  transform: translateY(-2px);
}

/* ── EDUCATION ── */
.edu-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s ease;
}

.edu-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201,168,76,0.15);
}

.edu-card .edu-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.edu-card .edu-place {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.3rem;
}

.edu-card .edu-status {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── REFEREES ── */
.referee-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.referee-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s ease;
}

.referee-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(201,168,76,0.15);
  transform: translateY(-2px);
}

.referee-card .referee-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.referee-card .referee-role {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.3rem;
}

.referee-card .referee-company {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 0.15rem;
}

.referee-card .referee-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s;
}

.referee-card .referee-phone:hover { color: var(--accent); }

.referee-card .referee-phone svg {
  width: 14px; height: 14px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── CONTACT ── */
.contact-section {
  text-align: center;
  padding: 6rem 2rem;
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.contact-section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.contact-section h2 {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.contact-section p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  font-size: 1rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}

.contact-btn.primary {
  background: var(--accent);
  color: var(--bg);
}

.contact-btn.primary:hover {
  background: #d4b35a;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,168,76,0.3);
}

.contact-btn.secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.contact-btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.contact-btn svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── FOOTER ── */
.cv-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  nav.cv-nav .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(15,17,20,0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--border);
  }
  nav.cv-nav .nav-links.open { display: flex; }
  .mobile-toggle { display: block; }

  .hero { padding: 7rem 1.5rem 3rem; }
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .hero-text .hero-meta { justify-content: center; }
  .hero-image img { width: 200px; height: 200px; }
  .hero-image::before { inset: -10px; }

  .cv-section { padding: 3rem 1.5rem; }
  .about-grid, .edu-cards, .referee-grid { grid-template-columns: 1fr; }
  .timeline { padding-left: 2rem; }
  .timeline-item::before { left: -2rem; }

  .section-header h2 { font-size: 1.7rem; }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 2.2rem; }
  .hero-meta { flex-direction: column; align-items: center; }
}
