/* ===== Theme tokens (dark is default) ===== */
:root {
  /* brand */
  --emerald: #059669;
  /* 600 */
  --emerald-700: #047857;

  /* Status Colors */
  --status-development: #595d05;
  --status-rd: #d97706;
  /* Amber */
  --status-plan: #4b5563;
  /* Gray */

  /* DARK defaults - "Private Club" Aesthetic */
  --ink: #e5e5e5;
  /* Off-white for reduced eye strain */
  --ink-dim: #a3a3a3;
  --muted: #737373;
  --paper: #080808;
  /* Deep black/grey */
  --edge: #121212;
  /* Very subtle surface */
  --frame: rgba(255, 255, 255, .08);

  /* Ghost Button Vars (DARK) */
  --btn-ghost-bg: transparent;
  --btn-ghost-border: #333;
  --btn-ghost-hover: #ffffff;
  --btn-ghost-text-hover: #000;
}

/* Light mode overrides */
html[data-theme="light"] {
  --ink: #171717;
  --ink-dim: #404040;
  --muted: #737373;
  --paper: #f5f5f4;
  --edge: #ffffff;
  --frame: rgba(0, 0, 0, .12);

  --btn-ghost-bg: transparent;
  --btn-ghost-border: #d4d4d8;
  --btn-ghost-hover: #171717;
  --btn-ghost-text-hover: #fff;
}

/* ===== Base ===== */
* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

html {
  scroll-behavior: smooth
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Background Texture removed */

/* Typography Overrides */
h1,
h2,
h3,
h4 {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* kill blue link color */
a,
a:visited {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: .9
}


/* ===== Layout ===== */
.wrap {
  position: relative;
  /* Anchor for toggle */
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 0;
  padding: 8vh 1.5rem 4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ===== Theme toggle (Frosted Glass) ===== */
.theme-toggle-btn {
  position: absolute;
  top: 2rem;
  right: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;

  /* Glass Effect */
  background: rgba(255, 255, 255, 0.05);
  /* Very transparent fill */
  backdrop-filter: blur(12px);
  /* Blurs the content behind it */
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  /* Subtle rim lighting */

  /* Depth & Shadow */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  /* Inner shine */

  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  color: var(--ink);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2),
    0 0 15px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px) scale(1.05);
}

.theme-toggle-btn:development {
  transform: scale(0.95);
}

.theme-toggle-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.5s ease;
}

.theme-toggle-btn:hover svg {
  transform: rotate(15deg);
}

/* Icon Switching */
.theme-toggle-btn .moon-icon {
  display: none;
}

.theme-toggle-btn .sun-icon {
  display: block;
}

html[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: block;
}

html[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: none;
}



/* ===== Brand ===== */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 2rem;
}

.logo-wrap {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.brand-name {
  font-size: clamp(2rem, 5vw, 2.5rem);
  margin: 0;
  line-height: 1;
}

.brand-tag {
  margin-top: 6px;
  color: var(--emerald);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

/* ===== Intro ===== */
.intro {
  margin: 0 auto 2.5rem;
  color: var(--ink-dim);
  max-width: 48rem;
}

.hero-sub {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  line-height: 1.6;
  margin: 0;
  color: var(--ink);
}

/* ===== Actions ===== */
.actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.btn,
.btn:visited {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.6rem;
  border-radius: 2px;
  border: 1px solid var(--frame);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  background: #fff0;
  color: var(--ink);
  transition: .2s ease;
}

.btn-primary,
.btn-primary:visited {
  background: var(--emerald);
  color: #fff;
  border-color: var(--emerald);
}

.btn-primary:hover {
  background: var(--emerald-700);
  border-color: var(--emerald-700);
}

.btn-ghost {
  background: var(--btn-ghost-bg);
  border-color: var(--btn-ghost-border);
}

.btn-ghost:hover {
  background: var(--btn-ghost-hover);
  color: var(--btn-ghost-text-hover);
  border-color: var(--btn-ghost-hover);
}

/* ===== Dividers ===== */
.divider {
  width: 60px;
  height: 1px;
  background: var(--frame);
  margin: 0 auto 3rem;
}

.divider-small {
  width: 30px;
  height: 1px;
  background: var(--frame);
  margin: 3rem auto;
  opacity: 0.5;
}

/* ===== Text Sections (Vision / Governance) ===== */
.text-section {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.section-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink-dim);
  text-align: justify;
  text-align-last: center;
}

/* Governance Specific */
.governance .compliance-box {
  border: 1px solid var(--frame);
  padding: 2rem;
  background: var(--edge);
}

.governance p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.governance strong {
  color: var(--ink);
}

.director-sig {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--frame);
  padding-top: 1rem;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.director-sig span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.director-sig strong {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
}

/* ===== Portfolio Grid ===== */
.portfolio-section {
  width: 100%;
  text-align: center;
}

.section-heading {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'Inter', sans-serif;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  text-align: left;
}

.portfolio-card {
  background: var(--edge);
  border: 1px solid var(--frame);
  padding: 1.5rem;
  border-radius: 2px;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.portfolio-card:hover {
  border-color: var(--emerald);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
  /* Prevent collision */
}

.card-icon {
  width: 32px;
  height: 32px;
  color: var(--emerald);
}

.card-icon-img {
  width: 48px;
  height: auto;
  object-fit: contain;
  margin-top: -6px;
  /* Audit alignment */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.meta-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid currentColor;
}

.badge.development {
  color: var(--status-development);
  background: rgba(226, 237, 15, 0.1);
}

.badge.rd {
  color: var(--status-rd);
  background: rgba(217, 119, 6, 0.1);
}

.badge.planning {
  color: var(--status-plan);
  background: rgba(75, 85, 99, 0.1);
}

.card-title {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.card-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 1.5rem;
  flex: 1;
}

.btn-link {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--frame);
  width: fit-content;
  transition: .2s;
}

.btn-link:not(.disabled):hover {
  color: var(--emerald);
  border-color: var(--emerald);
}

.btn-link.disabled {
  color: var(--frame);
  border-color: transparent;
  cursor: default;
}

/* ===== Footer - Identity Data ===== */
.foot {
  padding: 3rem 1.5rem 4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--frame);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  /* Center the constrained items */
}

/* Constrain footer items */
.foot>* {
  width: 100%;
  max-width: 1000px;
}

.identity-data {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  opacity: 0.8;
}

.identity-data p {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
}

.id-name {
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem !important;
}

.id-legal {
  font-style: italic;
  opacity: 0.7;
  margin-top: 0.5rem !important;
}

.copyright {
  opacity: 0.5;
  font-size: 0.75rem;
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: -1rem;
  /* Pull closer to identity data */
  margin-bottom: 0.5rem;
}

.footer-legal a,
.footer-legal a:visited {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
  border-bottom: 1px solid transparent;
}

.footer-legal a:hover {
  opacity: 1;
  border-color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .text-section .section-body {
    text-align: left;
  }
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  html.is-init * {
    opacity: 0;
    transform: translateY(10px);
  }

  html.is-loaded * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
}