/* ============================================
   dgilperez.com
   Editorial minimalism — warm, intelligent, unhurried
   ============================================ */

/* ============================================
   Custom Properties
   ============================================ */
:root {
  /* Warm parchment palette */
  --bg: #faf8f5;
  --bg-warm: #f5f1eb;
  --text: #2c2c2c;
  --text-secondary: #6b6b6b;
  --text-tertiary: #999;
  --accent: #e8dfc9;
  --accent-warm: #d4c4a8;
  --divider: #e0dbd4;
  --highlight: #fff8e7;

  /* Typography */
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Crimson Pro", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing - golden ratio inspired */
  --space-xs: 0.5rem;
  --space-sm: 0.875rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --content-width: 36rem;
  --reading-width: 32rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b1a;
    --bg-warm: #242322;
    --text: #e5e3df;
    --text-secondary: #a8a5a0;
    --text-tertiary: #706d68;
    --divider: #3a3836;
    --accent: #3d3a35;
    --accent-warm: #4a4640;
    --highlight: #2a2825;
  }
}

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

html {
  font-size: clamp(17px, 0.9vw + 15px, 20px);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  padding: 0;
}

/* Subtle entrance */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
  animation: fadeIn 0.6s ease-out;
}

@media (max-width: 600px) {
  main {
    padding: var(--space-xl) var(--space-md);
  }
}

/* ============================================
   Typography
   ============================================ */
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw + 1rem, 4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 var(--space-xs) 0;
  color: var(--text);
}

h2 {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-tertiary);
  margin: 0 0 var(--space-sm) 0;
}

p {
  margin: 0 0 var(--space-sm) 0;
  max-width: var(--reading-width);
}

p:last-child {
  margin-bottom: 0;
}

em {
  font-style: italic;
  color: var(--text-secondary);
}

/* ============================================
   Header
   ============================================ */
header {
  margin-bottom: var(--space-xl);
}

.tagline {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: 0.01em;
}

/* ============================================
   Sections
   ============================================ */
section {
  margin-bottom: var(--space-lg);
}

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

.intro p {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
}

/* ============================================
   Lists
   ============================================ */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.4rem;
  line-height: 1.55;
}

li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
}

/* ============================================
   Domains
   ============================================ */
.domains {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.domains span {
  white-space: nowrap;
}

.domains span:not(:last-child)::after {
  content: "×";
  margin: 0 0.5rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* ============================================
   Dividers
   ============================================ */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--divider) 20%,
    var(--divider) 80%,
    transparent 100%
  );
  margin: var(--space-xl) 0;
}

/* ============================================
   Links
   ============================================ */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent-warm);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

a:hover {
  text-decoration-color: var(--text);
  background: var(--highlight);
  border-radius: 2px;
}

/* Social links */
.social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
}

.social a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.social a:hover {
  color: var(--text);
  background: none;
  border-bottom-color: var(--text);
}

/* ============================================
   Footer
   ============================================ */
footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--divider);
}

.signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: 0.02em;
}

/* ============================================
   Accessibility & Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main { animation: none; }
  a { transition: none; }
  .social a { transition: none; }
}

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

/* ============================================
   Print
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  main {
    padding: 0;
    animation: none;
  }

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

  .social a::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #666;
  }

  .divider {
    background: #ccc;
  }
}

/* ============================================
   Selection
   ============================================ */
::selection {
  background: var(--accent);
  color: var(--text);
}
