:root {
  --ink: #1e1e1e;
  --bg: #f7f6f2;
  --paper: #fffef8;
  --accent: #ffd166;
  --accent-2: #cde8ff;
  --maxw: 780px;
  --edge: 2.25px;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Karla", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Main fixed header */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #FFFEF9;
  padding: clamp(16px, 3vw, 24px) clamp(24px, 4vw, 48px) clamp(8px, 2vw, 24px);
  border-bottom: 1px solid transparent;
  will-change: padding, box-shadow, border-bottom-color;
}

.header-content {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  max-width: calc(100% - 110px);
  flex: 1;
}

.header-name {
  font-family: "Shadows Into Light Two", cursive;
  font-weight: 600;
  font-size: 4rem;
  margin: 0;
  letter-spacing: .5px;
  line-height: 1;
  will-change: font-size;
  max-width: 100%;
}

.header-subtitle {
  font-family: "Karla", sans-serif;
  font-size: 1.2rem;
  opacity: 0.85;
  margin: 12px 0 0;
  max-width: 100%;
  will-change: font-size;
  /* white-space: nowrap;*/
}

.header-icons {
  position: fixed;
  top: clamp(16px, 3vw, 24px);
  right: clamp(24px, 4vw, 48px);
  display: flex;
  gap: 12px;
  z-index: 1001;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: block;
  transition: transform 0.2s ease;
}

.icon-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.icon-btn:hover {
  transform: scale(1.1) rotate(-3deg);
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto 120px;
  padding: 0 clamp(24px, 4vw, 48px) clamp(24px, 4vw, 48px);
  padding-top: 160px;
}

@media (max-width: 768px) {
  .wrap {
    padding-top: 235px;
  }
}

h1 {
  font-family: "Shadows Into Light Two", cursive;
  font-weight: 600;
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  margin: 0;
}


.sheet {
  position: relative;
  padding: clamp(16px, 2.4vw, 24px);
  margin: clamp(20px, 3vw, 28px) 0;
}

.sketch-wrap { 
  position: relative; 
}
.sketch-wrap svg.sketch-border {
  position: absolute; 
  inset: -10px;
  width: calc(100% + 20px); 
  height: calc(100% + 20px);
  pointer-events: none;
}

h2 {
  font-family: "Shadows Into Light Two", cursive;
  font-size: clamp(1.35rem, 2vw + .9rem, 1.8rem);
  margin: 0 0 8px;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.sub { margin-top: 18px; opacity: .85; }

ul { padding-left: 1.1rem; margin: .4rem 0 .2rem; }
li { margin: .25rem 0; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.muted { opacity: .8; }

.main-footer {
  text-align: center !important;
  padding: 20px;
  margin: 0 auto;
  width: 100%;
  display: block;
}

.footer-content {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
  opacity: 0.65;
  text-align: center !important;
  display: block;
}

.footer-replit {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.footer-replit:hover {
  opacity: 0.8;
}


@media (max-width:540px) {
  .top { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .actions { width: 100%; }
  .btn { flex: 1; justify-content: center; }
}

@media (prefers-color-scheme: dark) {
  :root { --ink:#161616; --bg:#0f0f0e; --paper:#fffdf6; }
  body { color:#0e0e0e; }
  .sheet { color: var(--ink); }
}
