/* Cleandod — Mac Storage Guides
   v1.4 · Migrated from Tailwind to vanilla */

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

:root {
  --stone-900: #1c1917;
  --stone-800: #292524;
  --stone-700: #44403c;
  --stone-600: #57534e;
  --stone-500: #78716c;
  --stone-400: #a8a29e;
  --stone-200: #e7e5e4;
  --stone-100: #f5f5f4;
  --stone-50: #faf9f7;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --red-500: #ef4444;
  --white: #ffffff;
  --font-body: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'Menlo', monospace;
  --max-width: 1140px;
  --content-width: 720px;
  --gap: 1.5rem;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(28,25,23,.05);
  --shadow-sm: 0 2px 8px rgba(28,25,23,.07);
  --shadow-md: 0 6px 20px rgba(28,25,23,.09);
  --ease: .2s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--stone-800);
  background: var(--stone-50);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-700); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--teal-600); }

h1, h2, h3, h4 { color: var(--stone-900); font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(1.875rem, 4.5vw, 2.75rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); letter-spacing: -.02em; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
p { color: var(--stone-600); }

/* ---- Container ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gap); }
.container-narrow { max-width: var(--content-width); margin: 0 auto; padding: 0 var(--gap); }

/* ---- Top Bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250,249,247,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stone-200);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--stone-900);
  text-decoration: none;
}

.logo:hover { color: var(--stone-900); }
.logo svg { width: 28px; height: 28px; }

.nav-links { display: flex; align-items: center; gap: 1.75rem; }

.nav-links a {
  color: var(--stone-500);
  font-size: .9rem;
  font-weight: 500;
  transition: color var(--ease);
}

.nav-links a:hover, .nav-links a.active { color: var(--stone-900); }

.nav-cta {
  padding: .45rem 1.1rem;
  background: var(--teal-600);
  color: var(--white) !important;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  transition: background var(--ease);
}

.nav-cta:hover { background: var(--teal-700); color: var(--white) !important; }

.burger {
  display: none;
  background: none;
  border: 1px solid var(--stone-200);
  border-radius: 6px;
  padding: .3rem .5rem;
  cursor: pointer;
  color: var(--stone-700);
}

/* ---- Hero / Page Top ---- */
.page-hero {
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(175deg, var(--teal-50) 0%, var(--stone-50) 55%);
}

.page-hero h1 { margin-bottom: .75rem; }

.page-hero .lead {
  font-size: 1.1rem;
  color: var(--stone-500);
  max-width: 580px;
  line-height: 1.75;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--stone-400);
  margin-bottom: var(--gap);
}

.breadcrumb a { color: var(--stone-500); }
.breadcrumb a:hover { color: var(--teal-600); }

.tag {
  display: inline-block;
  padding: .2rem .7rem;
  background: var(--teal-100);
  color: var(--teal-700);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .75rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.5rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none;
  border: none;
}

.btn-teal { background: var(--teal-600); color: var(--white); }
.btn-teal:hover { background: var(--teal-700); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,148,136,.25); }

.btn-outline { background: transparent; color: var(--stone-700); border: 1.5px solid var(--stone-200); }
.btn-outline:hover { border-color: var(--stone-700); background: var(--white); color: var(--stone-900); }

/* ---- Article / Guide Content ---- */
.article-body {
  padding: 3rem 0 4rem;
}

.article-body h2 {
  margin: 2.5rem 0 .75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--stone-200);
}

.article-body h2:first-of-type { border-top: none; padding-top: 0; }

.article-body h3 {
  margin: 1.75rem 0 .5rem;
}

.article-body p { margin-bottom: 1rem; font-size: .95rem; line-height: 1.8; }

.article-body ul, .article-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--stone-600);
}

.article-body li { margin-bottom: .4rem; line-height: 1.75; font-size: .95rem; }

.article-body img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-xs);
}

.article-body blockquote {
  border-left: 3px solid var(--teal-500);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--teal-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--stone-700);
  font-style: italic;
  font-size: .95rem;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--stone-100);
  padding: .15em .4em;
  border-radius: 4px;
  color: var(--stone-800);
}

.article-body pre {
  background: var(--stone-900);
  color: #e7e5e4;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .875rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ---- Step Cards ---- */
.step-card {
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  transition: box-shadow var(--ease);
}

.step-card:hover { box-shadow: var(--shadow-sm); }

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal-600);
  color: var(--white);
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: .75rem;
}

.step-card h3 { margin-bottom: .5rem; }
.step-card p { font-size: .9rem; }

/* ---- Info Box ---- */
.info-box {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  font-size: .9rem;
  line-height: 1.65;
}

.info-box-tip { background: var(--teal-50); border: 1px solid #99f6e4; }
.info-box-warn { background: var(--amber-100); border: 1px solid #fde68a; }

.info-box svg { flex-shrink: 0; width: 20px; height: 20px; margin-top: .15rem; }

/* ---- Grid Layouts ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.card-body { padding: 1.25rem; }
.card-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-600); margin-bottom: .4rem; display: block; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.card-title a { color: var(--stone-900); }
.card-title a:hover { color: var(--teal-600); }
.card-excerpt { font-size: .85rem; color: var(--stone-500); line-height: 1.6; }
.card-meta { font-size: .75rem; color: var(--stone-400); margin-top: .6rem; }

/* ---- Section spacing ---- */
.section { padding: 4rem 0; }
.section-sm { padding: 2.5rem 0; }
.section-alt { background: var(--white); }

.section-head { text-align: center; max-width: 600px; margin: 0 auto 2.5rem; }
.section-head p { font-size: 1rem; color: var(--stone-500); margin-top: .5rem; }

/* ---- CTA Banner ---- */
.cta-banner {
  background: var(--stone-900);
  color: var(--white);
  text-align: center;
  padding: 3.5rem 1.5rem;
  border-radius: var(--radius-lg);
  margin: 3rem auto;
  max-width: var(--max-width);
}

.cta-banner h2 { color: var(--white); }
.cta-banner p { color: var(--stone-400); max-width: 480px; margin: .75rem auto 1.5rem; }

/* ---- Table of Contents sidebar ---- */
.toc {
  position: sticky;
  top: 82px;
  font-size: .8rem;
}

.toc-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--stone-400);
  margin-bottom: .75rem;
}

.toc ul { list-style: none; }
.toc li { margin-bottom: .5rem; }
.toc a { color: var(--stone-500); transition: color var(--ease); }
.toc a:hover, .toc a.toc-active { color: var(--teal-600); font-weight: 500; }

/* ---- Contact Form ---- */
.form-row { margin-bottom: 1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--stone-700); margin-bottom: .3rem; }

.form-control {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--stone-200);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--stone-800);
  background: var(--white);
  transition: border-color var(--ease);
  outline: none;
}

.form-control:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20,184,166,.1);
}

textarea.form-control { min-height: 120px; resize: vertical; }

/* ---- Contact Info ---- */
.contact-item {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.contact-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-50);
  border-radius: 8px;
  flex-shrink: 0;
  color: var(--teal-600);
}

.contact-icon svg { width: 16px; height: 16px; }
.contact-label { font-weight: 600; font-size: .85rem; }
.contact-value { font-size: .85rem; color: var(--stone-500); }

/* ---- Team ---- */
.team-member { text-align: center; }
.team-photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin: 0 auto .65rem; border: 3px solid var(--white); box-shadow: var(--shadow-xs); }
.team-name { font-weight: 700; font-size: .9rem; }
.team-role { font-size: .8rem; color: var(--stone-400); }

/* ---- Footer ---- */
.site-footer {
  background: var(--stone-900);
  color: var(--stone-400);
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--white);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: .75rem;
}

.footer-brand svg { width: 24px; height: 24px; }

.footer-desc { font-size: .85rem; line-height: 1.6; max-width: 280px; }

.footer-heading {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--white);
  margin-bottom: .75rem;
}

.footer-list { list-style: none; }
.footer-list li { margin-bottom: .45rem; }
.footer-list a { color: var(--stone-400); font-size: .85rem; transition: color var(--ease); }
.footer-list a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid #292524;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  color: var(--stone-500);
}

/* ---- Legal Pages ---- */
.legal-header {
  padding: 3rem 0;
  background: var(--white);
  border-bottom: 1px solid var(--stone-200);
}

.legal-body { padding: 3rem 0; }
.legal-body h2 { margin: 2rem 0 .6rem; font-size: 1.25rem; }
.legal-body h3 { margin: 1.5rem 0 .4rem; font-size: 1.05rem; }
.legal-body p { margin-bottom: .9rem; font-size: .9rem; }
.legal-body ul { padding-left: 1.5rem; margin-bottom: .9rem; }
.legal-body li { margin-bottom: .3rem; font-size: .9rem; color: var(--stone-600); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--stone-50);
    flex-direction: column;
    padding: 1rem var(--gap);
    border-bottom: 1px solid var(--stone-200);
    gap: .6rem;
    box-shadow: var(--shadow-sm);
  }
  .nav-links.is-open { display: flex; }
  .burger { display: block; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .cta-banner { border-radius: 0; margin-left: -var(--gap); margin-right: -var(--gap); }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
}

/* TODO: add scroll-based reading progress */
/* FIXME: footer grid alignment on iPad landscape */
