/* ==========================================================================
   Suretta Brand Stylesheet
   Minimal, modern, semantic CSS with automatic OS light/dark mode plus a
   zero-JavaScript manual toggle via #theme-toggle + :has().
   ========================================================================== */

:root {
  color-scheme: light dark;
  --bg-page: #ffffff;
  --bg-surface: #f7f7fa;
  --bg-surface-hover: #efeff5;
  --text-primary: #181a24;
  --text-secondary: #52566b;
  --text-muted: #767b91;
  --border-subtle: #e3e5ed;
  --accent-purple: #7c22b8;
  --accent-blue: #2c4ab8;
  --accent-tint: rgba(124, 34, 184, 0.08);
  --radius-sm: 6px;
  --radius-md: 12px;
  --max-width: 880px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #0e1017;
    --bg-surface: #161923;
    --bg-surface-hover: #1e2230;
    --text-primary: #f2f4fa;
    --text-secondary: #a6adc4;
    --text-muted: #727991;
    --border-subtle: #252a3a;
    --accent-purple: #a855f7;
    --accent-blue: #60a5fa;
    --accent-tint: rgba(168, 85, 247, 0.14);
  }
}

/* Manual override when OS is light: checking #theme-toggle switches to dark */
:root:has(#theme-toggle:checked) {
  color-scheme: dark;
  --bg-page: #0e1017;
  --bg-surface: #161923;
  --bg-surface-hover: #1e2230;
  --text-primary: #f2f4fa;
  --text-secondary: #a6adc4;
  --text-muted: #727991;
  --border-subtle: #252a3a;
  --accent-purple: #a855f7;
  --accent-blue: #60a5fa;
  --accent-tint: rgba(168, 85, 247, 0.14);
}

/* Manual override when OS is dark: checking #theme-toggle switches to light */
@media (prefers-color-scheme: dark) {
  :root:has(#theme-toggle:checked) {
    color-scheme: light;
    --bg-page: #ffffff;
    --bg-surface: #f7f7fa;
    --bg-surface-hover: #efeff5;
    --text-primary: #181a24;
    --text-secondary: #52566b;
    --text-muted: #767b91;
    --border-subtle: #e3e5ed;
    --accent-purple: #7c22b8;
    --accent-blue: #2c4ab8;
    --accent-tint: rgba(124, 34, 184, 0.08);
  }
}

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

html {
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

/* Visually hidden checkbox for zero-JS theme toggle */
.theme-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand img {
  width: 30px;
  height: 33px;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.site-nav a {
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent-purple);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
  border-color: var(--accent-purple);
}

.theme-checkbox:focus-visible ~ .site-header .theme-toggle {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

/* Label text reflects the theme clicking will switch to */
.theme-label-light {
  display: none;
}

.theme-label-dark {
  display: inline;
}

#theme-toggle:checked ~ .site-header .theme-label-light {
  display: inline;
}

#theme-toggle:checked ~ .site-header .theme-label-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .theme-label-light {
    display: inline;
  }

  .theme-label-dark {
    display: none;
  }

  #theme-toggle:checked ~ .site-header .theme-label-light {
    display: none;
  }

  #theme-toggle:checked ~ .site-header .theme-label-dark {
    display: inline;
  }
}

/* Main Content */
main {
  flex: 1;
  padding: 4rem 0 5rem;
}

/* Hero Section (Home) */
.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-mark {
  width: 72px;
  height: auto;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.hero-blurb {
  margin: 0;
  max-width: 58ch;
  font-size: 1.15rem;
  color: var(--text-secondary);
}

/* Section Headings */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 3rem 0 1.5rem;
}

.section-header h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.text-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-purple);
}

.text-link:hover {
  text-decoration: underline;
}

/* Project Cards */
.project-list {
  display: grid;
  gap: 1.25rem;
}

.project-card {
  display: block;
  padding: 1.75rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent-purple);
  transform: translateY(-1px);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background-color: var(--accent-tint);
  color: var(--accent-purple);
  font-weight: 600;
  font-size: 0.75rem;
}

.project-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.project-card p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 62ch;
}

/* Page Intro (Projects Index) */
.page-intro {
  margin-bottom: 2.5rem;
}

.page-intro h1 {
  margin: 0 0 0.75rem;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-intro p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 60ch;
}

/* Project Detail Page */
.breadcrumb {
  display: inline-block;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breadcrumb:hover {
  color: var(--accent-purple);
}

.detail-header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-header h1 {
  margin: 0.5rem 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.detail-lead {
  margin: 0 0 1.5rem;
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 62ch;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  background-color: var(--accent-purple);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease;
}

.button-primary:hover {
  opacity: 0.9;
}

.detail-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
  margin: 0;
}

.detail-specs dt {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.detail-specs dd {
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
}

.detail-body {
  padding-top: 2rem;
}

.detail-body h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.detail-body p {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  max-width: 65ch;
}

.feature-grid {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.feature-grid li {
  padding: 1.25rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.feature-grid strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.feature-grid span {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}
