/* Travis Goldston — Personal Website
   Palette: blue, indigo, violet
   Tone: Elegant, minimal, premium, calm */

:root {
  /* Colors */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --violet-100: #ede9fe;
  --violet-200: #ddd6fe;
  --violet-300: #c4b5fd;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --violet-800: #5b21b6;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --white: #ffffff;

  /* Semantic */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --accent: var(--indigo-600);
  --accent-hover: var(--indigo-700);
  --accent-light: var(--indigo-500);
  --bg: var(--white);
  --bg-subtle: var(--gray-50);
  --border: var(--gray-200);

  /* Typography */
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Lora", "Georgia", serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;
  --space-6xl: 12rem;

  /* Layout */
  --container-max: 720px;
  --container-wide: 960px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  padding-top: max(var(--space-xl), env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0));
  backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
}

.nav-logo {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  padding: var(--space-xs) 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active {
  font-weight: 500;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary);
}

.nav-toggle:hover {
  background: var(--bg-subtle);
}

.nav-toggle-icon {
  width: 20px;
  height: 14px;
  position: relative;
}

.nav-toggle-icon span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle-icon span:nth-child(1) { top: 0; }
.nav-toggle-icon span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle-icon span:nth-child(3) { bottom: 0; }

.nav-open .nav-toggle-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-open .nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Container */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  border: none;
}

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

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

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

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--gray-300);
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-headline {
  font-size: clamp(1.75rem, 5vw + 1rem, 4rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.hero-subtext {
  font-size: clamp(1rem, 2.5vw + 0.5rem, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-3xl);
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: var(--space-2xl);
}

.lead {
  font-size: clamp(1rem, 1.5vw + 0.5rem, 1.125rem);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Page sections */
.page-hero {
  padding-top: calc(var(--space-5xl) + 60px);
  padding-bottom: var(--space-5xl);
}

/* Hero with photo (home) */
.hero-with-photo .container {
  max-width: var(--container-wide);
}

.hero-layout {
  display: grid;
  gap: var(--space-4xl);
  align-items: center;
}

@media (min-width: 768px) {
  .hero-layout {
    grid-template-columns: 1fr 380px;
  }

  .hero-with-photo .hero-content {
    max-width: 36em;
  }
}

.hero-intro {
  margin-bottom: var(--space-3xl);
}

.btn-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-image-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-subtle);
}

.hero-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.page-section {
  padding: var(--space-5xl) 0;
}

.page-section + .page-section {
  border-top: 1px solid var(--border);
}

/* Footer */
.footer {
  padding: var(--space-4xl) var(--space-xl) var(--space-3xl);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-xl);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  min-height: 48px;
  font-family: var(--font-sans);
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 160px;
  padding-top: var(--space-md);
  resize: vertical;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.gallery-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-subtle);
  transition: opacity 0.2s;
}

.gallery-item:hover {
  opacity: 0.92;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Blog / Writing */
.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

.post-item {
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.post-title a {
  transition: color 0.2s;
}

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

.post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* About layout */
.about-grid {
  display: grid;
  gap: var(--space-4xl);
  align-items: start;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1.5fr;
  }
}

.about-grid .lead {
  max-width: 42em;
}

/* Work / case studies */
.work-article {
  padding-top: var(--space-4xl);
}

.work-article:first-child {
  padding-top: 0;
}

.work-article + .work-article {
  border-top: 1px solid var(--border);
  margin-top: var(--space-4xl);
}

.work-label {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

/* Where I'm most useful */
.useful-intro {
  max-width: 36em;
}

.useful-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4xl);
}

.useful-item {
  padding-top: var(--space-2xl);
}

.useful-item:first-child {
  padding-top: 0;
}

.useful-item + .useful-item {
  border-top: 1px solid var(--border);
}

.useful-item-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

/* Responsive: tablet and down */
@media (max-width: 768px) {
  .page-hero {
    padding-top: calc(var(--space-4xl) + 56px);
    padding-bottom: var(--space-4xl);
  }

  .hero-intro {
    margin-bottom: var(--space-2xl);
  }

  .hero-layout {
    gap: var(--space-2xl);
  }

  .hero-subtext {
    margin-bottom: var(--space-2xl);
  }

  .page-section {
    padding: var(--space-4xl) 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .useful-item-title {
    font-size: 1.125rem;
  }
}

/* Responsive: mobile */
@media (max-width: 640px) {
  .nav {
    padding: var(--space-md) var(--space-lg);
    padding-top: max(var(--space-md), env(safe-area-inset-top));
  }

  .nav-inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: flex;
    order: 1;
  }

  .nav-logo {
    order: 0;
  }

  .nav-links {
    display: none;
    order: 2;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    margin-top: var(--space-sm);
  }

  .nav-open .nav-links {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    padding: var(--space-md) 0;
    font-size: 1rem;
    min-height: 44px;
  }

  .container,
  .container-wide {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .page-hero {
    padding-top: calc(var(--space-3xl) + 52px);
    padding-bottom: var(--space-3xl);
  }

  .hero-headline {
    margin-bottom: var(--space-sm);
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
    min-height: 48px;
  }

  .btn {
    min-height: 48px;
  }

  .footer {
    padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .about-grid {
    gap: var(--space-2xl);
  }

  .about-grid > div:first-child img {
    max-height: 320px;
    width: 100%;
    object-fit: cover;
  }

  .work-article {
    padding-top: var(--space-2xl);
  }

  .work-article + .work-article {
    margin-top: var(--space-2xl);
  }

  .useful-list {
    gap: var(--space-2xl);
  }

  .useful-item {
    padding-top: var(--space-xl);
  }
}

/* Very small screens */
@media (max-width: 380px) {
  .container,
  .container-wide {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .nav {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}
