/* ===========================
   y0 Brand Kit — style.css
   =========================== */

@font-face {
  font-family: 'Calsans';
  src: url('https://cdn.prod.website-files.com/67c7446d252afaf3ede16a0b/67c9b59ff7467ae98bb86568_CalSans-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* --- Custom Properties --- */
:root {
  --black: #000000;
  --white: #FFFFFF;
  --gold: #FFCC00;
  --card-fill: #1a1a1a;
  --white-50: #ffffff80;
  --black-50: #00000080;
  --surface: #0d0d0d;

  --font-display: 'Calsans', Arial, sans-serif;
  --font-body: 'Manrope', sans-serif;

  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;
  --space-2xl: 120px;

  --container-max: 940px;
  --sidebar-width: 240px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-pill: 100px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.3s;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background-color: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.2px;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

.gold { color: var(--gold); }

/* --- Sidebar Navigation --- */
.brand-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 0.5px solid #ffffff12;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) var(--space-md);
  z-index: 100;
}

.brand-nav__logo {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 0.5px solid #ffffff12;
}
.brand-nav__logo img { width: 100%; max-width: 160px; }

.brand-nav__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.brand-nav__link {
  color: var(--white-50);
  font-size: 14px;
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);
}

.brand-nav__link:hover {
  color: var(--white);
  text-decoration: none;
}

.brand-nav__link.is-active {
  color: var(--white);
  border-left-color: var(--gold);
}

.brand-nav__cta {
  display: inline-block;
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--border-radius-pill);
  text-align: center;
  text-decoration: none;
  transition: opacity var(--duration);
}

.brand-nav__cta:hover { opacity: 0.85; text-decoration: none; }

.mobile-nav-toggle { display: none; }

/* --- Main Layout --- */
.brand-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.brand-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* --- Sections --- */
.brand-section {
  padding: var(--space-2xl) 0;
  border-bottom: 0.5px solid #ffffff0d;
}

.brand-section--fill { background: var(--surface); }
.brand-section--dark { background: var(--card-fill); }

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

.brand-section__title {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: var(--space-sm);
}

.brand-section__desc {
  color: var(--white-50);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
  max-width: 600px;
}

.brand-section__subtitle {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: var(--space-md);
}

.brand-section__sub { margin-top: var(--space-xl); }

/* --- Hero --- */
.brand-hero { min-height: 100vh; display: flex; align-items: center; }

.brand-hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.brand-hero__title {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  letter-spacing: -2px;
  margin-bottom: var(--space-md);
}

.brand-hero__subtitle {
  font-size: 20px;
  color: var(--white-50);
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.brand-hero__body {
  font-size: 16px;
  color: var(--white-50);
  font-weight: 500;
  line-height: 1.7;
}

.brand-hero__mark {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-hero__mark-img {
  width: 100%;
  max-width: 300px;
}

/* --- Logo Cards --- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.logo-card {
  background: var(--card-fill);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.logo-card--wide { grid-column: span 2; }

.logo-card__toggle {
  display: flex;
  gap: var(--space-xs);
}

.bg-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 3px;
  transition: border-color var(--duration);
}

.bg-toggle.is-active { border-color: var(--gold); }
.bg-toggle__swatch { display: block; width: 100%; height: 100%; border-radius: 50%; }

.logo-card__preview {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  border-radius: var(--border-radius-sm);
  transition: background-color var(--duration) var(--ease-out);
}

.logo-card[data-bg="dark"] .logo-card__preview { background: var(--black); }
.logo-card[data-bg="light"] .logo-card__preview { background: var(--white); }
.logo-card[data-bg="gold"] .logo-card__preview { background: var(--gold); }

.logo-card__img { max-width: 40%; max-height: 80px; }
.logo-card__img--wide { max-width: 70%; max-height: 60px; }

.logo-card__actions { display: flex; gap: var(--space-xs); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  background: var(--card-fill);
  color: var(--white);
  border: 0.5px solid var(--white-50);
  border-radius: var(--border-radius-pill);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration), color var(--duration), border-color var(--duration);
}

.btn:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
  text-decoration: none;
}

.btn--sm { padding: 5px 14px; font-size: 13px; }

.btn--large {
  padding: 16px 40px;
  font-size: 18px;
  text-align: center;
}

.btn--gold {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.btn--gold:hover {
  background: #e6b800;
  border-color: #e6b800;
}

.btn__size {
  display: block;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
  margin-top: 4px;
}

/* --- Color Cards --- */
.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.color-grid--secondary { margin-top: var(--space-md); }

.color-card {
  background: var(--card-fill);
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform var(--duration) var(--ease-out);
}

.color-card:hover { transform: translateY(-2px); }

.color-card__swatch { height: 100px; }
.color-card--large .color-card__swatch { height: 180px; }

.color-card__info {
  padding: var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.color-card__name { font-weight: 500; font-size: 14px; }
.color-card__hex { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; color: var(--white-50); }

.color-card__copied {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--gold);
  color: var(--black);
  padding: 6px 16px;
  border-radius: var(--border-radius-pill);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.color-card.is-copied .color-card__copied {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* --- Typography Showcase --- */
.type-showcase {
  background: var(--card-fill);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.type-showcase__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 0.5px solid #ffffff1a;
}

.type-showcase__name {
  font-family: var(--font-display);
  font-size: 24px;
}

.type-showcase__meta {
  color: var(--white-50);
  font-size: 14px;
}

.type-sample-calsans { font-family: var(--font-display); }

.type-showcase__sample { margin-bottom: var(--space-lg); }

.type-showcase__alphabet,
.type-showcase__numbers {
  color: var(--white-50);
  font-size: 20px;
  line-height: 2;
  letter-spacing: 2px;
  margin-bottom: var(--space-sm);
}

.type-showcase__note {
  color: var(--white-50);
  font-size: 12px;
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 0.5px solid #ffffff1a;
}

.type-showcase__weights { display: flex; flex-direction: column; }

.type-weight {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 0.5px solid #ffffff0d;
}

.type-weight__label {
  color: var(--white-50);
  font-size: 12px;
  min-width: 120px;
  font-weight: 500;
}

.type-weight__sample { font-size: 20px; }

/* Type Hierarchy */
.type-hierarchy { margin-top: var(--space-xl); }

.type-hierarchy__row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: baseline;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 0.5px solid #ffffff0d;
}

.type-hierarchy__label {
  color: var(--white-50);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.type-hierarchy__spec {
  color: var(--white-50);
  font-size: 12px;
  text-align: right;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* --- Usage Cards --- */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.usage-card {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.usage-card__badge {
  padding: var(--space-xs) var(--space-sm);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.usage-card--do .usage-card__badge { background: #22c55e20; color: #22c55e; }
.usage-card--dont .usage-card__badge { background: #ef444420; color: #ef4444; }

.usage-card__preview {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 160px;
  padding: var(--space-md);
  position: relative;
}

.usage-card__preview--bad::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent 47%, #ef444480 47%, #ef444480 53%, transparent 53%);
  pointer-events: none;
}

.usage-card__img { max-height: 60px; }

.usage-card__text {
  padding: var(--space-sm);
  font-size: 14px;
  color: var(--white-50);
  background: var(--card-fill);
  line-height: 1.5;
}

/* Clear Space Demo */
.clearspace-demo {
  margin-top: var(--space-md);
  display: inline-block;
}

.clearspace-demo__zone {
  border: 1px dashed var(--white-50);
  padding: 40px;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  background: var(--black);
}

.clearspace-demo__img { height: 50px; }

/* --- Download Section --- */
.download-hero {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.download-table {
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--surface);
}

.download-table__header,
.download-table__row {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr auto;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-sm);
}

.download-table__header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white-50);
  border-bottom: 0.5px solid #ffffff1a;
}

.download-table__row {
  border-bottom: 0.5px solid #ffffff0a;
  font-size: 14px;
}

.download-table__row:last-child { border-bottom: none; }

/* --- Footer --- */
.brand-footer {
  padding: var(--space-xl) 0;
  border-top: 0.5px solid #ffffff0d;
}

.brand-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-footer__wordmark {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--white);
  text-decoration: none;
}
.brand-footer__wordmark:hover { text-decoration: none; opacity: 0.8; }

.brand-footer__copy {
  color: var(--white-50);
  font-size: 13px;
}

/* --- Scroll Animations --- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive: Tablet (991px) --- */
@media screen and (max-width: 991px) {
  .brand-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    border-right: none;
    border-bottom: 0.5px solid #ffffff12;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .brand-nav__logo {
    margin-bottom: 0;
    margin-right: auto;
    padding-bottom: 0;
    border-bottom: none;
  }
  .brand-nav__logo img { width: 100px; }

  .brand-nav__links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 var(--space-md);
    border-bottom: 0.5px solid transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration) var(--ease-out), padding var(--duration) var(--ease-out), border-color var(--duration);
  }

  .brand-nav__links.is-open {
    max-height: 400px;
    padding: var(--space-md);
    border-bottom-color: #ffffff12;
  }

  .brand-nav__link {
    padding: 12px var(--space-sm);
    border-left: none;
  }

  .brand-nav__link.is-active {
    color: var(--gold);
    border-left: none;
  }

  .brand-nav__cta { display: none; }

  .mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    z-index: 101;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--white);
    transition: transform var(--duration), opacity var(--duration);
    transform-origin: center;
  }

  .mobile-nav-toggle.is-open span:first-child {
    transform: rotate(45deg) translate(2px, 2px);
  }

  .mobile-nav-toggle.is-open span:last-child {
    transform: rotate(-45deg) translate(2px, -2px);
  }

  .brand-main {
    margin-left: 0;
    padding-top: 60px;
  }

  .brand-section { padding: var(--space-xl) 0; }
  .brand-section__header { margin-bottom: var(--space-lg); }
  .brand-section__title { font-size: 40px; }

  .brand-hero { min-height: auto; padding-top: var(--space-xl); }

  .brand-hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .brand-hero__title { font-size: 56px; }
  .brand-hero__mark-img { max-width: 200px; margin: 0 auto; }

  .logo-card--wide { grid-column: span 1; }
  .logo-grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }

  .type-hierarchy__row {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  .type-hierarchy__spec { text-align: left; }

  .download-table__header,
  .download-table__row {
    grid-template-columns: 1fr auto;
  }

  .download-table__header span:nth-child(2),
  .download-table__header span:nth-child(3),
  .download-table__row span:nth-child(2),
  .download-table__row span:nth-child(3) { display: none; }
}

/* --- Responsive: Mobile (767px) --- */
@media screen and (max-width: 767px) {
  .brand-section { padding: 60px 0; }
  .brand-section__header { margin-bottom: 36px; }
  .brand-section__title { font-size: 32px; }
  .brand-section__desc { font-size: 16px; }

  .brand-hero { padding-top: var(--space-lg); }
  .brand-hero__inner { gap: var(--space-md); }
  .brand-hero__title { font-size: 44px; }
  .brand-hero__mark-img { max-width: 120px; }

  .logo-grid { grid-template-columns: 1fr; }

  .color-grid { grid-template-columns: repeat(2, 1fr); }
  .color-card--large .color-card__swatch { height: 120px; }

  .usage-grid { grid-template-columns: repeat(2, 1fr); }
  .usage-card__preview { height: 130px; }

  .type-showcase { padding: var(--space-md); }
  .type-showcase__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  .type-showcase__sample span { font-size: 48px !important; }
  .type-showcase__alphabet,
  .type-showcase__numbers {
    font-size: 16px;
    letter-spacing: 1px;
    overflow-wrap: break-word;
    word-break: break-all;
  }

  .type-weight {
    flex-direction: column;
    gap: var(--space-xs);
  }
  .type-weight__sample { font-size: 17px; }

  .type-hierarchy__example { font-size: 28px !important; line-height: 1.2 !important; }

  .download-hero .btn--large {
    display: block;
    width: 100%;
  }

  .download-table__row { padding: var(--space-sm); }

  .brand-section__sub { margin-top: var(--space-lg); }

  .brand-footer__inner { flex-direction: column; gap: var(--space-sm); text-align: center; }
}

/* --- Responsive: Small Mobile (479px) --- */
@media screen and (max-width: 479px) {
  .brand-container { padding: 0 var(--space-sm); }

  .brand-section { padding: var(--space-lg) 0; }
  .brand-section__header { margin-bottom: var(--space-md); }

  .brand-hero__title { font-size: 36px; letter-spacing: -1px; }
  .brand-hero__subtitle { font-size: 18px; }
  .brand-hero__mark { display: none; }

  .color-grid { grid-template-columns: 1fr; }
  .color-card--large .color-card__swatch { height: 100px; }

  .usage-grid { grid-template-columns: 1fr; }
  .usage-card__preview { height: 120px; }

  .type-showcase__sample span { font-size: 36px !important; }
  .type-hierarchy__example { font-size: 22px !important; }

  .btn--large { padding: 14px 30px; font-size: 16px; }

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

  .clearspace-demo__zone { padding: 24px; }
}