:root {
  --color-primary: #0F172A;   /* Deep Navy Blue */
  --color-primary-2: #1E3A8A; /* lighter navy for gradients */
  --color-secondary: #3B82F6; /* Slate Blue */
  --color-accent: #DC2626;    /* Crimson */
  --color-accent-2: #D97706;  /* Dark Amber */
  --color-bg: #F8FAFC;        /* Clean Light Gray */
  --color-surface: #FFFFFF;
  --color-border: #E2E8F0;
  --color-text: #1E293B;      /* Dark Charcoal */
  --color-text-strong: #000000;
  --header-height: 84px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-top: calc(var(--header-height) + 4px);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Top accent + Fixed header ---------- */
.top-accent-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent-2));
  z-index: 1100;
}

.site-header {
  position: fixed;
  top: 4px;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-inner {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
}

/* ---------- Logo (real image, precision reveal) ---------- */
.logo-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.logo-img {
  display: block;
  height: 46px;
  width: auto;
  clip-path: inset(0 100% 0 0);
  animation: revealWordmark 5.95s ease-out infinite;
}

/* Caption is covered by two separate strips (top: "ENGINEERS OF NITTE",
   bottom: "KERALA") that straddle the line's own row-band (rows 127-135 of the
   188px-tall source) WITHOUT covering it, so the line renders uninterrupted
   and runs straight into the "e" glyph with no gap. */
.logo-caption-cover {
  position: absolute;
  left: 29.79%;
  width: 16.21%;
  background: var(--color-surface);
  opacity: 1;
  animation: revealCaption 5.95s ease-out infinite;
}

.logo-caption-cover.top {
  top: 54.79%;
  height: 12.23%;
}

.logo-caption-cover.bottom {
  top: 72.34%;
  height: 12.23%;
}

/* Reveal boundaries computed from the real logo pixel geometry (1326x188):
   line+e -> x745 (56.18%), n1 -> x870 (65.61%), n2 -> x989 (74.58%),
   i -> x1039 (78.36%), t -> x1102 (83.11%), k -> x1218 (91.86%), a -> x1326 (100%).
   Cycle length is 5.95s: reveal finishes at 2.95s (49.58%), then holds for
   exactly 3s before looping back to replay the reveal. */
@keyframes revealWordmark {
  0%     { clip-path: inset(0 100%   0 0); }
  2.02%  { clip-path: inset(0 100%   0 0); }
  7.06%  { clip-path: inset(0 43.82% 0 0); }
  10.92% { clip-path: inset(0 43.82% 0 0); }
  15.13% { clip-path: inset(0 34.39% 0 0); }
  18.15% { clip-path: inset(0 34.39% 0 0); }
  21.85% { clip-path: inset(0 25.42% 0 0); }
  24.87% { clip-path: inset(0 25.42% 0 0); }
  28.57% { clip-path: inset(0 21.64% 0 0); }
  31.09% { clip-path: inset(0 21.64% 0 0); }
  34.96% { clip-path: inset(0 16.89% 0 0); }
  37.98% { clip-path: inset(0 16.89% 0 0); }
  42.35% { clip-path: inset(0 8.14%  0 0); }
  45.38% { clip-path: inset(0 8.14%  0 0); }
  49.58% { clip-path: inset(0 0%     0 0); }
  100%   { clip-path: inset(0 0%     0 0); }
}

@keyframes revealCaption {
  0%      { opacity: 1; }
  49.58%  { opacity: 1; }
  57.98%  { opacity: 0; }
  100%    { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-img { clip-path: inset(0 0% 0 0); animation: none; }
  .logo-caption-cover { opacity: 0; animation: none; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-2) 100%);
  color: #F8FAFC;
  padding: 64px 0 56px;
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  color: #FFFFFF;
  margin: 0 0 28px;
  text-align: left;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero p {
  color: #CBD5E1;
  text-align: justify;
  text-justify: inter-word;
  margin: 0 0 20px;
  max-width: 720px;
  margin-right: 8%;
}

.bulletin-announcement {
  background: rgba(248, 250, 252, 0.06);
  border: 1px solid rgba(248, 250, 252, 0.18);
  border-left: 4px solid var(--color-accent-2);
  padding: 24px 28px;
  border-radius: 8px;
  margin-top: 40px;
}

.bulletin-announcement p {
  color: #F1F5F9;
  font-weight: 500;
  margin: 0 0 18px;
  max-width: none;
  margin-right: 0;
}

.bulletin-btn {
  display: inline-block;
  background: var(--color-accent-2);
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 6px;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.bulletin-btn:hover,
.bulletin-btn:focus-visible {
  background: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
}

/* ---------- Sections ---------- */
.section {
  padding: 64px 0;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-primary);
  margin: 0 0 36px;
  text-align: left;
  font-weight: 700;
}

p {
  text-align: justify;
  text-justify: inter-word;
  margin: 0 0 20px;
  max-width: 720px;
}

/* ---------- What Defines Us ---------- */
.defines {
  background: #EEF2F8;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-secondary);
  border-radius: 10px;
  padding: 30px 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.card-icon {
  width: 44px;
  height: 44px;
  color: var(--color-secondary);
  margin-bottom: 16px;
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card h3 {
  font-size: 1.1rem;
  color: var(--color-primary);
  margin: 0 0 12px;
  text-align: left;
  font-weight: 700;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
  max-width: none;
}

/* ---------- Coming soon ---------- */
.coming-soon {
  background: var(--color-bg);
  text-align: center;
  padding: 56px 0;
}

.coming-soon p {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1.1rem;
  max-width: none;
  text-align: center;
  margin: 0;
}

.coming-soon p span {
  color: var(--color-accent-2);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary);
  padding: 28px 0;
}

.site-footer p {
  text-align: left;
  margin: 0;
  font-size: 0.85rem;
  color: #94A3B8;
  max-width: none;
}

@media (max-width: 640px) {
  .header-inner, .container { padding: 0 20px; }
  .hero p, .welcome .container p { margin-right: 0; }
  :root { --header-height: 68px; }
  .logo-img { height: 36px; }
}

/* ---------- Bulletin Viewer ---------- */
.bulletin-viewer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.bulletin-viewer.open {
  display: flex;
}

.bv-stage {
  position: relative;
  max-width: min(90vw, 800px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bv-stage img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  background: #fff;
}

.bv-page-indicator {
  margin-top: 14px;
  color: #CBD5E1;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.bv-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: transparent;
  border: none;
  color: #F8FAFC;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}

.bv-close:hover { color: var(--color-accent); }

.bv-arrow {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: #F8FAFC;
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 24px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bv-arrow:hover { background: rgba(255,255,255,0.18); border-color: var(--color-secondary); }
.bv-arrow:disabled { opacity: 0.3; cursor: default; }

@media (max-width: 640px) {
  .bv-arrow { width: 42px; height: 42px; font-size: 1.5rem; margin: 0 10px; }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0B1220;
    --color-surface: #1E293B;
    --color-border: #334155;
    --color-text: #E2E8F0;
    --color-text-strong: #F8FAFC;
  }

  .defines { background: #111C33; }
  .site-header { background: #0F172A; box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
  .logo-caption-cover { background: #0F172A; }
  .card { background: #16213A; }
  .coming-soon { background: #0B1220; }
}
