/* css/style.css — Workshop warm cream theme */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  --bg: #faf8f3;
  --text: #1a1a1a;
  --text-muted: #6b5e52;
  --accent: #8b2500;
  --accent-hover: #a62e00;
  --border: #e5ddd3;
  --surface: #f0ece5;
  --code-bg: #f5f1eb;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --font-serif: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --font-size-h1: clamp(1.75rem, 1.25rem + 1.75vw, 2.5rem);
  --font-size-h2: clamp(1.4rem, 1.1rem + 1.5vw, 2rem);
  --font-size-h3: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --font-size-small: 0.875rem;
  --line-height: 1.7;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --max-width-prose: 680px;
  --max-width-wide: 960px;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

p {
  margin-bottom: var(--space-sm);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

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

a:visited {
  color: #6b2000;
}

/* ============================================
   Layout
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.container--narrow {
  max-width: var(--max-width-prose);
}

/* ============================================
   Skip Link
   ============================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: var(--space-xs) var(--space-sm);
  z-index: 10000;
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Header & Navigation
   ============================================ */
.site-header {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.site-mark {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.site-mark:hover {
  color: var(--accent);
}

.site-mark:visited {
  color: var(--text);
}

/* ============================================
   Main Content
   ============================================ */
main {
  padding: var(--space-md) 0 var(--space-lg);
}

/* ============================================
   Homepage
   ============================================ */
.personal-home {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 1.125rem;
  font-weight: 450;
  line-height: 1.7;
}

.personal-home main {
  padding: 0;
}

.founder-page {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) 1.5rem 3rem;
}

.founder-page h1 {
  font-family: inherit;
  font-size: clamp(1.75rem, 4vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}

.founder-photo {
  float: right;
  width: 112px;
  height: 140px;
  margin: 0 0 1rem 1.5rem;
  border-radius: 4px;
  object-fit: cover;
}

.founder-bio a,
.founder-contact a,
.founder-work a {
  font-weight: 550;
}

.founder-bio p {
  margin-bottom: 1.25rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0.25rem;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font:
    500 0.9rem/1.5 system-ui,
    sans-serif;
}

.profile-links svg {
  width: 20px;
  height: 20px;
  fill: currentcolor;
}

.founder-contact {
  font-size: 1em;
  overflow-wrap: anywhere;
}

.founder-work {
  clear: both;
  margin-top: 2rem;
}

.founder-work h2 {
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 650;
  margin-bottom: 0.75rem;
}

.founder-work ul {
  list-style: disc;
  padding-left: 1.2rem;
}

.founder-work li {
  margin-bottom: 0.6rem;
  padding-left: 0.2rem;
  font-size: 1em;
}

@media (width <= 420px) {
  .founder-photo {
    width: 80px;
    height: 100px;
    margin-left: 1rem;
  }
}

/* ============================================
   Post / Article Content
   ============================================ */
.post-content {
  max-width: var(--max-width-prose);
}

.post-content h2 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.post-content h3 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

.post-content ul,
.post-content ol {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
}

.post-content li {
  margin-bottom: var(--space-xs);
}

.post-content code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
  border: 1px solid var(--border);
  color: var(--text);
}

.post-content pre {
  background: var(--code-bg);
  color: var(--text);
  padding: var(--space-sm);
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border);
}

.post-content pre code {
  background: none;
  padding: 0;
  border: none;
  color: inherit;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: var(--space-sm) 0;
  border: 1px solid var(--border);
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-sm);
  margin: var(--space-sm) 0;
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.05em;
}

.post-content video {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin: var(--space-sm) 0;
}

/* ============================================
   Post Date (bottom of article)
   ============================================ */
.post-date {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
  color: var(--text-muted);
  margin-top: var(--space-lg);
}

/* ============================================
   Back Links
   ============================================ */
.back-link {
  display: inline-block;
  margin-top: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--accent);
}

.back-link:visited {
  color: var(--text-muted);
}

/* ============================================
   Project Page
   ============================================ */
.project-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-top: 0.25rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s ease;
}

.project-links a:hover {
  background: rgba(139, 37, 0, 0.08);
  text-decoration: none;
}

.project-links a:visited {
  color: var(--accent);
}

/* ============================================
   Related Content
   ============================================ */
.related-content {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.related-content h2 {
  font-size: var(--font-size-h3);
  margin-bottom: var(--space-sm);
}

.related-content ul {
  list-style: none;
}

.related-content li {
  padding: var(--space-xs) 0;
}

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

.mt-md {
  margin-top: var(--space-md);
}

.text-light {
  color: var(--text-muted);
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.founder-work .project-summary {
  font-weight: 450;
}

.article-page {
  font-size: 1.125rem;
  font-weight: 450;
}

.article-page .container {
  max-width: 728px;
  padding-right: 1.5rem;
  padding-left: 1.5rem;
}

.article-page .site-header {
  border: 0;
  padding: 2rem 0 0;
}

.article-page .site-mark {
  font-size: 1rem;
  font-weight: 550;
  letter-spacing: 0;
}

.article-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 1rem;
  overflow-wrap: break-word;
}

.article-page h2 {
  font-size: 1.5rem;
  font-weight: 650;
  margin-top: 2.5rem;
}

.article-page h3 {
  font-size: 1.25rem;
  font-weight: 650;
}

.article-page strong {
  font-weight: 650;
}

.article-page .post-content {
  margin-top: 1.75rem;
  overflow-wrap: anywhere;
}

.article-page .post-content a {
  font-weight: 550;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-page a:visited {
  color: var(--accent);
}

.article-page .project-tagline {
  font-size: 1.125rem;
  font-style: normal;
  color: var(--text-muted);
}

.article-page .project-links a {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 550;
  text-transform: none;
  letter-spacing: 0;
}

.article-page .back-link,
.article-page .post-date {
  font-family: inherit;
  font-size: 1rem;
}

.article-page .post-content p {
  margin-bottom: 1.25rem;
}

.article-page hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.article-page .post-content pre {
  line-height: 1.6;
  overflow-wrap: normal;
}

.article-page .post-content code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
}

.article-page .code-block {
  margin: 1.5rem 0;
}

.article-page .code-block .comment {
  color: #595959;
}

.article-page .code-block .bug {
  color: #a12622;
  font-weight: 600;
}

.article-page .code-block .fix {
  color: #226039;
  font-weight: 600;
}

.article-page .tool-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.article-page .post-content .play-btn,
.article-page .tool-cta a {
  display: inline-block;
  padding: 0.65rem 1rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.article-page .post-content .play-btn:hover,
.article-page .tool-cta a:hover {
  background: var(--accent-hover);
  text-decoration: underline;
}

.article-page .email-demo {
  text-align: center;
  margin: 2rem 0;
}

.article-page .email-demo video {
  width: 280px;
  max-width: 100%;
}

.article-page figcaption {
  color: var(--text-muted);
  font-size: 1rem;
}
