/* ============================================================================
   CSS Custom Properties (Design Tokens)
   ============================================================================ */

:root {
  /* Dark mode (default) */
  --bg: #0f1923;
  --bg-card: #1a2535;
  --bg-card-hover: #1f2d40;
  --text-primary: #f2eee2;
  --text-secondary: rgba(242, 238, 226, 0.62);
  --text-tertiary: rgba(242, 238, 226, 0.38);
  --accent: #c9a96e;
  --accent-hover: #dfc38c;
  --border: rgba(242, 238, 226, 0.08);
  --border-hover: rgba(201, 169, 110, 0.35);

  /* Font families */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-ui: 'Inter', system-ui, sans-serif;

  /* Layout */
  --max-width: 720px;
  --section-gap: 4.5rem;
}

/* Light mode overrides */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2eee2;
    --bg-card: #e8e3d5;
    --bg-card-hover: #ddd8c8;
    --text-primary: #0f1923;
    --text-secondary: rgba(15, 25, 35, 0.62);
    --text-tertiary: rgba(15, 25, 35, 0.38);
    --accent: #8a6a3a;
    --accent-hover: #6b5030;
    --border: rgba(15, 25, 35, 0.1);
    --border-hover: rgba(138, 106, 58, 0.4);
  }
}

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */

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

html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

/* ============================================================================
   Layout
   ============================================================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 2rem;
}

/* ============================================================================
   Animation
   ============================================================================ */

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

.animate {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.animate-1 {
  animation-delay: 0s;
}

.animate-2 {
  animation-delay: 0.15s;
}

.animate-3 {
  animation-delay: 0.3s;
}

/* ============================================================================
   Hero Section
   ============================================================================ */

.hero {
  margin-bottom: var(--section-gap);
}

h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.2rem, 6vw, 5rem);
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: var(--text-primary);
  margin: 0 0 1.25rem 0;
}

.tagline {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0;
  max-width: 560px;
}

/* ============================================================================
   Consulting Section
   ============================================================================ */

.consulting {
  margin-bottom: var(--section-gap);
}

.consulting p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0;
  max-width: 560px;
}

/* ============================================================================
   Projects Section
   ============================================================================ */

.projects {
  margin-bottom: var(--section-gap);
}

.projects h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 1.75rem 0;
}

.projects h2:nth-of-type(2) {
  margin-top: 2rem;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ============================================================================
   Link-Preview Card Component
   ============================================================================ */

.project-card-link {
  display: block;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  transition: transform 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.project-card-link:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}

.project-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.project-card__image {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card-hover);
}

.project-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.project-card__title {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.project-card__description {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card__domain {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.project-card__favicon {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
}

.project-card__domain-text {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Past project label */
.project-card-link--past .project-card__title::after {
  content: ' — past project';
  font-weight: 300;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ============================================================================
    AI Card — Particle Canvas & Sheen Animation
    ============================================================================ */

.project-card-link--ai {
  position: relative;
  overflow: hidden;
}

.project-card__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.project-card__icon-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.project-card__icon-sheen {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.15);
  animation: icon-breathe 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes icon-breathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.1), 0 0 6px rgba(201, 169, 110, 0.0); }
  50%       { box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.35), 0 0 12px rgba(201, 169, 110, 0.12); }
}

/* ============================================================================
    AI Page Specific Styles
    ============================================================================ */

.ai-list {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.ai-list__item {
  margin-bottom: 0.75rem;
}

.ai-section-label {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

/* ============================================================================
     Responsive Design
     ============================================================================ */

@media (max-width: 640px) {
  .container {
    padding: 2rem 1.25rem;
  }

  .project-card__image {
    width: 56px;
    height: 56px;
    border-radius: 10px;
  }
}
