/* ============================================
   Tyler Wince - Apple-Inspired Theme
   Precision, clarity, and attention to detail
   ============================================ */

/* === TYPOGRAPHY === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* === DESIGN TOKENS === */
:root {
  /* Typography - SF Pro style */
  --font-system: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', sans-serif;

  /* Colors - Apple Light Mode */
  --color-bg: #ffffff;
  --color-surface: #f5f5f7;
  --color-surface-elevated: #ffffff;
  --color-text-primary: #1d1d1f;
  --color-text-secondary: #86868b;
  --color-text-tertiary: #a1a1a6;
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;
  --color-border: #d2d2d7;
  --color-border-light: #e5e5e5;

  /* Spacing - Apple's 4px grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Layout */
  --max-width-text: 692px;
  --max-width-content: 980px;
  --max-width-wide: 1440px;
  --border-radius: 12px;
  --border-radius-lg: 18px;

  /* Transitions - Apple's curves */
  --ease-out: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-in-out: cubic-bezier(0.42, 0, 0.58, 1);
  --transition-fast: 200ms var(--ease-out);
  --transition-base: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-in-out);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-surface: #161616;
    --color-surface-elevated: #1d1d1f;
    --color-text-primary: #f5f5f7;
    --color-text-secondary: #86868b;
    --color-text-tertiary: #6e6e73;
    --color-accent: #2997ff;
    --color-accent-hover: #409cff;
    --color-border: #424245;
    --color-border-light: #2c2c2e;
  }
}

/* === BASE STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-system);
  font-weight: 400;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  color: var(--color-text-primary);
  background: var(--color-bg);
  transition: background var(--transition-base), color var(--transition-base);
}

/* === TYPOGRAPHY SCALE === */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 0.6em;
}

h1 {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.07143;
}

h2 {
  font-size: clamp(32px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h3 {
  font-size: clamp(24px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

p {
  margin-bottom: 1.2em;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

strong {
  font-weight: 600;
}

/* === LAYOUT PRIMITIVES === */
.site-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: var(--space-4) var(--space-6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 0.5px solid var(--color-border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-base);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(0, 0, 0, 0.8);
    border-bottom-color: var(--color-border);
  }
}

.site-header.scrolled {
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
}

.header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
}

.site-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

.site-title a {
  color: var(--color-text-primary);
}

.site-title a:hover {
  opacity: 0.7;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-8);
  align-items: center;
  margin: 0;
}

.site-nav a {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.site-nav a:hover {
  opacity: 1;
}

.site-nav a.active {
  opacity: 1;
  font-weight: 600;
}

.site-main {
  flex: 1;
}

.site-footer {
  padding: var(--space-6);
  margin-top: var(--space-20);
  border-top: 0.5px solid var(--color-border-light);
  background: var(--color-surface);
}

.footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-6);
  align-items: center;
}

.footer-text {
  color: var(--color-text-secondary);
  font-size: 12px;
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
}

.footer-links a {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 400;
}

.footer-links a:hover {
  color: var(--color-accent);
}

/* === CONTENT WRAPPER === */
.content-wrapper {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
}

.content-wrapper-narrow {
  max-width: var(--max-width-text);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
}

/* === COMPONENTS === */

/* Link Arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  font-weight: 400;
  color: var(--color-accent);
  transition: opacity var(--transition-fast);
}

.link-arrow::after {
  content: '→';
  font-size: 19px;
  transition: transform var(--transition-fast);
}

.link-arrow:hover::after {
  transform: translateX(3px);
}

/* Card */
.card {
  background: var(--color-surface-elevated);
  border: 0.5px solid var(--color-border-light);
  border-radius: var(--border-radius);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  .card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

/* Divider */
.divider {
  height: 0.5px;
  background: var(--color-border-light);
  margin: var(--space-16) 0;
}

/* Quote */
blockquote {
  border-left: 2px solid var(--color-accent);
  padding-left: var(--space-4);
  margin: var(--space-8) 0;
  font-size: 19px;
  line-height: 1.42105;
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* Code */
code {
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 6px;
}

pre {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  padding: var(--space-4);
  overflow-x: auto;
  margin: var(--space-6) 0;
}

pre code {
  background: none;
  padding: 0;
}

.code-copy-button {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 400;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
}

pre:hover .code-copy-button {
  opacity: 1;
}

.code-copy-button:hover {
  background: var(--color-accent-hover);
}

/* Lists */
ul, ol {
  margin-left: 1.2em;
  margin-bottom: 1.2em;
}

li {
  margin-bottom: 0.4em;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 600ms var(--ease-out) both;
}

.animate-in-delay-1 {
  animation-delay: 100ms;
}

.animate-in-delay-2 {
  animation-delay: 200ms;
}

.animate-in-delay-3 {
  animation-delay: 300ms;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding: var(--space-3) var(--space-4);
  }

  .header-inner {
    height: 40px;
  }

  .site-nav ul {
    gap: var(--space-5);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-4);
  }

  .footer-links {
    justify-content: center;
  }

  .content-wrapper,
  .content-wrapper-narrow {
    padding: var(--space-12) var(--space-4);
  }
}

/* === UTILITIES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
