/* KADALAS — Designers Community */

:root {
  --ink: #0e0e0d;
  --paper: #f5f1e8;
  --paper-deep: #ebe5d6;
  --muted: #6e6a60;
  --rule: rgba(14, 14, 13, 0.14);

  --font-display: "Instrument Serif", "Noto Sans Malayalam", Georgia, serif;
  --font-text: "Inter", "Noto Sans Malayalam", system-ui, sans-serif;
  --font-ml: "Noto Sans Malayalam", "Inter", system-ui, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 1280px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease);
  padding-top: env(safe-area-inset-top, 0px);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.75rem;
}

.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  line-height: 1;
}
.brand-text { display: flex; flex-direction: column; }
.logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
}
.logo-lg { width: 96px; height: 96px; }
.footer-brand {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2rem);
}
.footer-brand-text .descriptor { margin-top: 0.8rem; }
.wordmark {
  font-family: var(--font-ml);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  letter-spacing: -0.01em;
}
.descriptor {
  margin-top: 0.4rem;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.28em;
}

.nav { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); }
.nav a {
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  padding-block: 0.5rem;
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.2rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.5rem, 10vw, 8rem) clamp(4rem, 9vw, 7rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 8.2vw, 7.4rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.hero-copy {
  margin: 2.25rem 0 0;
  max-width: 30ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  color: var(--muted);
}

/* The sheet */
.sheet-stage {
  position: relative;
  justify-self: center;
  width: min(100%, 420px);
  animation: sheet-in 1.2s var(--ease) both;
}
.sheet {
  position: relative;
  aspect-ratio: 1 / 1.414;
  background: #fbf9f3;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 30px 60px -30px rgba(14,14,13,0.35);
  padding: 12% 11% 10%;
  overflow: hidden;
}
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(6.2% - 1px),
    rgba(14,14,13,0.07) calc(6.2% - 1px),
    rgba(14,14,13,0.07) 6.2%
  );
  background-position: 0 14%;
  pointer-events: none;
}
.sheet::after {
  /* folded corner */
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 16%; height: 16%;
  background: linear-gradient(225deg, var(--paper) 50%, var(--paper-deep) 50%);
  box-shadow: -1px 1px 0 rgba(14,14,13,0.06);
}
.sheet-mark {
  position: absolute;
  left: 11%;
  bottom: 10%;
  font-family: var(--font-ml);
  font-weight: 300;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.sheet-line {
  position: absolute;
  left: 11%;
  top: 12%;
  width: 0;
  height: 1px;
  background: var(--ink);
  animation: draw-line 1s 0.7s var(--ease) forwards;
}
.sheet-note {
  position: absolute;
  left: 11%;
  top: 20%;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--muted);
  opacity: 0;
  animation: fade-in 0.9s 1.2s var(--ease) forwards;
}
.sheet-mark { animation: fade-in 0.9s 1.5s var(--ease) both; }

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(18px) rotate(-1.2deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes draw-line { to { width: 34%; } }
@keyframes fade-in   { to { opacity: 1; } }

/* ---------- About ---------- */
.about {
  border-top: 1px solid var(--rule);
  padding-block: clamp(4.5rem, 11vw, 9rem);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.about h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 14ch;
}
.about-body p {
  margin: 0 0 1.4rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.7;
  max-width: 52ch;
}
.about-body p:last-child {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.3;
}

/* ---------- Connect / CTA ---------- */
.connect {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(5rem, 13vw, 10rem);
}
.connect h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 6.8rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 16ch;
}
.connect p {
  margin: 2rem 0 3rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: #b9b4a8;
  max-width: 40ch;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.35rem 2.2rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  transition: background-color 0.4s var(--ease);
}
.cta-arrow { display: inline-block; transition: transform 0.5s var(--ease); }
.cta:hover { background: var(--paper-deep); }
.cta:hover .cta-arrow { transform: translate(3px, -3px); }
.connect :focus-visible { outline-color: var(--paper); }

/* ---------- Footer ---------- */
.site-footer { padding-block: clamp(3.5rem, 8vw, 6rem) 2.5rem; }
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.footer-brand .wordmark { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1; }
.footer-tagline {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-align: right;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Reveal on scroll (no-JS safe: content visible by default) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid,
  .about-grid { grid-template-columns: 1fr; }
  .sheet-stage { order: -1; width: min(72%, 320px); }
  .hero-copy { max-width: 36ch; }
  .about h2 { max-width: none; }
}

@media (max-width: 520px) {
  .nav { gap: 1.1rem; }
  .nav a { letter-spacing: 0.16em; font-size: 0.66rem; }
  .descriptor { letter-spacing: 0.2em; }
  .footer-tagline { text-align: left; }
  .logo { width: 44px; height: 44px; }
  .logo-lg { width: 72px; height: 72px; }
  .cta { width: 100%; justify-content: space-between; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .sheet-line { width: 34%; }
  .sheet-note, .sheet-mark { opacity: 1; }
}
