/* ============================================================
   ARNAB GUPTA — Personal Professional Website
   Design System & Global Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;0,900;1,400;1,700&family=Outfit:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --forest:      #0f2419;
  --forest-2:    #1a3a2a;
  --forest-3:    #2c5c3f;
  --forest-4:    #3d7a58;
  --amber:       #c47c2a;
  --amber-2:     #e09840;
  --amber-3:     #f5c87a;
  --cream:       #f7f2e9;
  --cream-2:     #ede5d4;
  --ink:         #141210;
  --ink-2:       #2e2a24;
  --ink-3:       #5a5248;
  --white:       #fdfaf5;
  --red-fragile: #8b2020;

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Outfit', system-ui, sans-serif;
  --mono:  'JetBrains Mono', monospace;

  --nav-h: 66px;
  --w:     1180px;
  --r:     3px;
  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--sans); background: var(--white); color: var(--ink); line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

h1,h2,h3 { font-family: var(--serif); line-height: 1.15; }
h1 { font-size: clamp(2.6rem, 5.5vw, 4.8rem); font-weight: 900; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 500; }
h4 { font-size: 1.05rem; font-weight: 600; font-family: var(--sans); }
p  { font-size: 1.05rem; color: var(--ink-2); max-width: 70ch; }

.wrap   { max-width: var(--w); margin: 0 auto; padding: 0 2rem; }
.sec    { padding: 6rem 0; }
.sec-sm { padding: 3.5rem 0; }

/* Labels & rules */
.label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); display: block; margin-bottom: 0.8rem; }
.rule  { width: 40px; height: 2px; background: var(--amber); margin: 0.9rem 0 2.2rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.72rem 1.7rem; border-radius: var(--r); font-family: var(--sans); font-size: 0.88rem; font-weight: 500; letter-spacing: 0.025em; cursor: pointer; border: none; transition: all 0.22s var(--ease); white-space: nowrap; }
.btn-dk { background: var(--forest); color: var(--white); }
.btn-dk:hover { background: var(--forest-3); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,36,25,0.3); }
.btn-ol { background: transparent; color: var(--forest); border: 1.5px solid var(--forest-3); }
.btn-ol:hover { background: var(--forest); color: var(--white); }
.btn-am { background: var(--amber); color: var(--white); }
.btn-am:hover { background: var(--amber-2); transform: translateY(-2px); }
.btn-wh { background: transparent; color: var(--cream); border: 1.5px solid rgba(247,242,233,0.4); }
.btn-wh:hover { background: rgba(247,242,233,0.1); }

/* Tags */
.tag { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 100px; font-size: 0.73rem; font-weight: 500; letter-spacing: 0.04em; font-family: var(--sans); }
.tg { background: #d2ede0; color: var(--forest-2); }
.ta { background: #f5e2c4; color: #7a4a10; }
.ts { background: var(--cream-2); color: var(--ink-3); }
.td { background: var(--forest-2); color: var(--cream); }
.tr { background: #f5d2d2; color: var(--red-fragile); }

/* ── NAV ── */
.nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 200; background: rgba(253,250,245,0.94); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(196,124,42,0.13); transition: box-shadow 0.3s; }
.nav.scrolled { box-shadow: 0 2px 24px rgba(15,36,25,0.09); }
.nav-in { max-width: var(--w); margin: 0 auto; padding: 0 2rem; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--forest); }
.nav-logo em { color: var(--amber); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; }
.nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--ink-3); transition: color 0.2s; position: relative; }
.nav-links a::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 1.5px; background: var(--amber); transform: scaleX(0); transition: transform 0.22s var(--ease); transform-origin: left; }
.nav-links a:hover, .nav-links a.active { color: var(--forest); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-cta { font-size: 0.82rem !important; padding: 0.42rem 1.1rem; background: var(--forest) !important; color: var(--white) !important; border-radius: var(--r); }
.nav-cta:hover { background: var(--forest-3) !important; }
.nav-cta::after { display: none !important; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--forest); transition: all 0.3s; }

/* ── PAGE HERO (inner pages) ── */
.page-hero { background: var(--forest); padding: calc(var(--nav-h) + 4rem) 0 4rem; position: relative; overflow: hidden; }
.page-hero::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--amber), transparent); }
.page-hero .label { color: var(--amber-3); }
.page-hero h1 { color: var(--cream); margin-bottom: 1rem; }
.page-hero p  { color: rgba(247,242,233,0.65); }

/* ── CARDS & GRIDS ── */
.do-section { background: var(--cream); }
.do-grid    { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.do-card    { background: var(--white); border-radius: 8px; border: 1px solid var(--cream-2); padding: 2rem 1.8rem; transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s; position: relative; overflow: hidden; }
.do-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--forest-4), var(--amber)); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.do-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(15,36,25,0.1); border-color: rgba(196,124,42,0.2); }
.do-card:hover::before { transform: scaleX(1); }
.do-icon { width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 1.2rem; }
.do-card h4 { font-size: 1.05rem; margin-bottom: 0.6rem; color: var(--forest); }
.do-card p  { font-size: 0.9rem; }

.recent-sec  { background: var(--cream); }
.recent-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
.recent-card { background: var(--white); border-radius: 8px; border: 1px solid var(--cream-2); padding: 1.8rem; transition: transform 0.22s var(--ease), box-shadow 0.22s; }
.recent-card:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(15,36,25,0.09); }
.recent-card h4 { margin-bottom: 0.5rem; color: var(--forest); }
.recent-card p  { font-size: 0.9rem; }

/* ── TIMELINE ── */
.tl { display: flex; flex-direction: column; position: relative; }
.tl::before { content: ''; position: absolute; left: 16px; top: 24px; bottom: 0; width: 1px; background: linear-gradient(to bottom, var(--amber), transparent); }
.tl-item { display: grid; grid-template-columns: 48px 1fr; gap: 1.5rem; padding: 0 0 2.5rem; }
.tl-dot  { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; border: 2px solid var(--cream-2); background: var(--white); position: relative; z-index: 1; margin-top: 2px; }
.tl-dot.now { border-color: var(--amber); background: var(--amber); }
.tl-body h4 { margin-bottom: 0.2rem; color: var(--forest); }
.tl-org     { font-size: 0.85rem; color: var(--amber); font-weight: 600; margin-bottom: 0.15rem; }
.tl-period  { font-family: var(--mono); font-size: 0.73rem; color: var(--ink-3); margin-bottom: 0.5rem; }
.tl-body p  { font-size: 0.88rem; }

/* ── GEO STRIP ── */
.geo-strip   { background: var(--forest-2); padding: 5rem 0; position: relative; overflow: hidden; }
.geo-bg      { position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(61,122,88,0.06) 20px, rgba(61,122,88,0.06) 21px); }
.geo-content { position: relative; z-index: 1; }
.geo-inner   { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.geo-text h2 { color: var(--cream); margin-bottom: 1rem; }
.geo-text p  { color: rgba(247,242,233,0.65); margin-bottom: 2rem; }
.geo-countries { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.geo-country   { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; padding: 0.25rem 0.65rem; border-radius: 100px; border: 1px solid rgba(196,124,42,0.28); color: var(--amber-3); }
.geo-map       { background: rgba(15,36,25,0.5); border-radius: 12px; border: 1px solid rgba(196,124,42,0.18); overflow: hidden; padding: 1.5rem; }

/* ── STATS BAND ── */
.stats-band { background: var(--amber); padding: 2rem 0; }
.stats-row  { max-width: var(--w); margin: 0 auto; padding: 0 2rem; display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.stat-cell  { text-align: center; }
.stat-cell strong { display: block; font-family: var(--serif); font-size: 2.2rem; font-weight: 700; color: var(--white); line-height: 1; }
.stat-cell span   { font-size: 0.8rem; color: rgba(255,255,255,0.8); letter-spacing: 0.04em; }

/* ── WRITING BAND ── */
.writing-band { background: var(--forest); padding: 5rem 0; text-align: center; position: relative; overflow: hidden; }
.writing-band::before { content: '"'; position: absolute; top: -2rem; left: 5%; font-family: var(--serif); font-size: 18rem; color: rgba(196,124,42,0.06); line-height: 1; pointer-events: none; }
.writing-band h2 { color: var(--cream); margin-bottom: 1rem; }
.writing-band p  { color: rgba(247,242,233,0.65); margin: 0 auto 2rem; }
.writing-band .btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── RESEARCH ── */
.filter-bar  { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.filter-btn  { padding: 0.38rem 1rem; border-radius: 100px; font-size: 0.8rem; font-weight: 500; border: 1.5px solid var(--cream-2); background: transparent; color: var(--ink-3); cursor: pointer; transition: all 0.2s; font-family: var(--sans); }
.filter-btn:hover, .filter-btn.active { background: var(--forest); color: var(--white); border-color: var(--forest); }
.pub-list    { display: flex; flex-direction: column; gap: 1.2rem; }
.pub-item    { display: grid; grid-template-columns: 72px 1fr; gap: 1.5rem; padding: 1.5rem; background: var(--cream); border-radius: 8px; border: 1px solid transparent; transition: border-color 0.2s, box-shadow 0.2s; }
.pub-item:hover { border-color: rgba(196,124,42,0.25); box-shadow: 0 4px 20px rgba(15,36,25,0.07); }
.pub-year    { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--amber); line-height: 1; padding-top: 0.2rem; }
.pub-body h4 { margin-bottom: 0.3rem; font-size: 0.98rem; line-height: 1.4; }
.pub-body h4 a { color: var(--forest); border-bottom: 1px dashed rgba(196,124,42,0.5); }
.pub-body h4 a:hover { color: var(--amber); }
.pub-authors { font-size: 0.8rem; color: var(--ink-3); margin-bottom: 0.3rem; }
.pub-journal { font-size: 0.82rem; font-style: italic; color: var(--ink-2); margin-bottom: 0.5rem; }
.pub-tags    { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ── PROJECTS ── */
.proj-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.proj-card { background: var(--white); border: 1px solid var(--cream-2); border-radius: 10px; overflow: hidden; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.proj-card:hover { transform: translateY(-5px); box-shadow: 0 12px 40px rgba(15,36,25,0.13); }
.proj-thumb { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 2.8rem; }
.proj-body  { padding: 1.4rem; }
.proj-body h4 { margin-bottom: 0.4rem; font-size: 1rem; }
.proj-body p  { font-size: 0.85rem; margin-bottom: 1rem; }
.proj-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pt-g { background: linear-gradient(135deg,#c8e8d4,#3d7a58); }
.pt-a { background: linear-gradient(135deg,#f5e0c4,#c47c2a); }
.pt-f { background: linear-gradient(135deg,#2c5c3f,#0f2419); }
.pt-b { background: linear-gradient(135deg,#c8dff5,#3a6fa5); }
.pt-m { background: linear-gradient(135deg,#1a3a2a,#c47c2a); }

/* ── WRITING ── */
.writing-list { display: flex; flex-direction: column; }
.writing-item { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; padding: 1.8rem; align-items: start; border-bottom: 1px solid var(--cream-2); transition: background 0.2s; }
.writing-item:hover { background: var(--cream); }
.writing-item:last-child { border-bottom: none; }
.writing-date { font-family: var(--mono); font-size: 0.73rem; color: var(--ink-3); white-space: nowrap; padding-top: 0.35rem; }
.writing-item h4 { margin-bottom: 0.35rem; }
.writing-item h4 a { color: var(--forest); }
.writing-item h4 a:hover { color: var(--amber); }
.writing-item p { font-size: 0.88rem; }

/* ── ABOUT ── */
.about-grid { display: grid; grid-template-columns: 1fr 300px; gap: 4rem; }
.prose p { margin-bottom: 1.4rem; }
.prose a { color: var(--forest); border-bottom: 1px solid rgba(196,124,42,0.4); }
.prose a:hover { border-color: var(--amber); }
.sidebar-card { background: var(--cream); border-radius: 8px; padding: 1.4rem; margin-bottom: 1.2rem; border: 1px solid rgba(196,124,42,0.1); }
.sidebar-card h5 { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber); margin-bottom: 0.9rem; }
.sidebar-list li { font-size: 0.87rem; color: var(--ink-2); padding: 0.35rem 0; border-bottom: 1px solid rgba(196,124,42,0.08); display: flex; align-items: center; gap: 0.5rem; }
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list li::before { content: '›'; color: var(--amber); }

/* ── CONTACT ── */
.contact-split  { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-method { display: flex; align-items: flex-start; gap: 1rem; padding: 1.4rem; background: var(--cream); border-radius: 8px; margin-bottom: 1rem; transition: transform 0.2s; }
.contact-method:hover { transform: translateX(4px); }
.c-icon { width: 42px; height: 42px; border-radius: 8px; background: var(--forest); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.contact-method h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 0.15rem; }
.contact-method a, .contact-method p { font-size: 0.92rem; color: var(--forest); }

/* ── FOOTER ── */
footer { background: var(--forest); color: var(--cream); padding: 3.5rem 0 2rem; }
.footer-grid { max-width: var(--w); margin: 0 auto; padding: 0 2rem; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }
.foot-brand p { font-size: 0.85rem; color: rgba(247,242,233,0.55); margin-top: 0.7rem; max-width: 30ch; }
.foot-col h5  { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); margin-bottom: 1rem; }
.foot-col li  { padding: 0.28rem 0; }
.foot-col li a { font-size: 0.85rem; color: rgba(247,242,233,0.6); transition: color 0.2s; }
.foot-col li a:hover { color: var(--amber-3); }
.foot-bottom { border-top: 1px solid rgba(196,124,42,0.18); padding: 1.5rem 2rem 0; max-width: var(--w); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 0.72rem; color: rgba(247,242,233,0.38); }

/* ── ANIMATIONS ── */
.fade-up { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.fade-up.vis { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .hero-body, .geo-inner { grid-template-columns: 1fr; }
  .hero-card { max-width: 380px; }
  .do-grid   { grid-template-columns: 1fr 1fr; }
  .geo-map   { display: none; }
  .recent-grid, .about-grid, .contact-split { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  :root { --nav-h: 58px; }
  .do-grid, .proj-grid { grid-template-columns: 1fr; }
  .pub-item, .writing-item { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-links.open { display: flex; flex-direction: column; position: fixed; top: var(--nav-h); left: 0; right: 0; background: var(--white); padding: 1.5rem 2rem; gap: 1.2rem; box-shadow: 0 8px 30px rgba(0,0,0,0.1); border-bottom: 1px solid var(--cream-2); z-index: 99; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .foot-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}
