/* ═══════════════════════════════════════════════════
   ARCO — style.css  v4
   Compact · Full-width · Deep palette · No wasted space
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400;1,500&family=DM+Sans:opsz,wght@9..40,200;9..40,300;9..40,400&family=DM+Mono:wght@300;400&display=swap');

:root {
  --rose:        #7d2455;
  --rose-mid:    #a83d6e;
  --rose-light:  #c47799;
  --rose-pale:   #f0dce8;
  --rose-dark:   #56183a;

  --steel:       #2d6070;
  --steel-mid:   #3d7a8a;
  --steel-light: #6fa8b8;
  --steel-pale:  #d4eaf0;
  --steel-dark:  #1a3d4a;

  --ink:         #0a1f33;
  --ink-soft:    #162d44;
  --ink-muted:   #2c4560;
  --ink-faint:   #4a6680;

  --surface:     #f5f7fa;
  --surface-2:   #eaecf2;
  --border:      #ced6e0;
  --border-soft: #e2e8f0;
  --text:        #1c3349;
  --text-muted:  #607080;
  --text-faint:  #96a8b8;
  --white:       #ffffff;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;

  --nav-h:    56px;
  --pad-x:    clamp(1.25rem, 4vw, 3.5rem);
  --radius:   8px;
  --radius-lg:12px;
  --radius-xl:18px;

  --shadow-xs: 0 1px 3px rgba(10,31,51,.06);
  --shadow-sm: 0 2px 10px rgba(10,31,51,.09);
  --shadow-md: 0 6px 24px rgba(10,31,51,.13);
  --shadow-lg: 0 18px 48px rgba(10,31,51,.17);

  --ease:        cubic-bezier(.25,.8,.25,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
  --ease-out:    cubic-bezier(0,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: var(--surface);
  min-height: 100vh;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Page system ── */
.page {
  display: none; flex-direction: column;
  min-height: 100vh; width: 100%;
  animation: pageFade .28s var(--ease-out) both;
}
.page.active { display: flex; }
@keyframes pageFade {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ══════════════════════════
   NAV
══════════════════════════ */
.site-nav {
  position: sticky; top: 0; z-index: 300;
  width: 100%; height: var(--nav-h);
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center;
  padding: 0 var(--pad-x);
  transition: box-shadow .3s var(--ease);
}
.site-nav.scrolled { box-shadow: var(--shadow-md); border-color: var(--border); }

.nav-logo {
  display: flex; align-items: center; gap: .6rem;
  margin-right: auto; cursor: pointer; flex-shrink: 0;
}
.nav-logo-icon { width: 28px; height: 28px; transition: transform .45s var(--ease-bounce); }
.nav-logo:hover .nav-logo-icon { transform: rotate(30deg) scale(1.08); }
.nav-logo-text {
  font-family: var(--font-display); font-size: 1.1rem;
  font-weight: 500; letter-spacing: .2em; color: var(--ink);
}

.nav-links { display: flex; align-items: center; }
.nav-links li a {
  display: flex; align-items: center;
  height: var(--nav-h); padding: 0 .95rem;
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); position: relative; cursor: pointer;
  transition: color .2s; white-space: nowrap;
}
.nav-links li a::after {
  content: ''; position: absolute;
  bottom: 0; left: .95rem; right: .95rem;
  height: 2px; background: var(--rose);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0); transform-origin: center;
  transition: transform .25s var(--ease);
}
.nav-links li a:hover, .nav-links li a.active { color: var(--ink); }
.nav-links li a.active::after, .nav-links li a:hover::after { transform: scaleX(1); }

.nav-burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: .5rem;
}
.nav-burger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--ink); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity:0; transform:scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  display: none; position: fixed;
  inset: var(--nav-h) 0 0; z-index: 290;
  background: rgba(255,255,255,.97); backdrop-filter: blur(24px);
  flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-family: var(--font-display); font-size: 1.4rem;
  font-style: italic; color: var(--ink); cursor: pointer;
  transition: color .2s, transform .2s var(--ease-bounce);
}
.nav-mobile a:hover { color: var(--rose); transform: translateX(6px); }

/* ══════════════════════════
   HOME LAYOUT — two-column split
   Left: hero text | Right: tool card
══════════════════════════ */
.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

/* ── LEFT PANEL — hero ── */
.hero {
  padding: 2rem var(--pad-x) 1.6rem;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  background: linear-gradient(180deg, var(--white) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border-soft);
  width: 100%;
}
.hero-lockup {
  display: flex; flex-direction: row; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
  opacity: 0; animation: fadeUp .45s .06s var(--ease-out) forwards;
}
.hero-icon { width: 54px; height: 54px; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 400;
  letter-spacing: .22em; color: var(--ink); line-height: 1;
}

.hero-desc {
  max-width: 700px;
  font-size: .88rem; line-height: 1.8;
  color: var(--text-muted); margin-bottom: .9rem;
  opacity: 0; animation: fadeUp .45s .14s var(--ease-out) forwards;
}

.hero-authors {
  font-size: .74rem; color: var(--text-faint);
  font-style: italic; line-height: 1.75;
  opacity: 0; animation: fadeUp .45s .22s var(--ease-out) forwards;
}
.hero-authors strong { font-style: normal; color: var(--text-muted); font-weight: 300; }
.hero-institution {
  display: block; font-size: .7rem;
  color: var(--text-faint); margin-top: .3rem; font-style: italic;
}

/* decorative divider between hero sections */
.hero-divider {
  width: 32px; height: 1px;
  background: var(--rose-light); margin: 1rem auto;
  opacity: .6;
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── RIGHT PANEL — tool ── */
.tool-wrap {
  padding: 1.4rem var(--pad-x) 2rem;
  display: flex; flex-direction: column;
  align-items: center;
  opacity: 0; animation: fadeUp .45s .3s var(--ease-out) forwards;
  width: 100%;
}
.tool-card {
  width: 100%;
  max-width: 1100px;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Tabs */
.tab-bar {
  display: flex;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1.6rem;
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .13em; text-transform: uppercase;
  border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; position: relative;
  transition: color .2s, background .2s;
}
.tab-btn::after {
  content: ''; position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2.5px; border-radius: 2px 2px 0 0;
  transform: scaleX(0); transition: transform .25s var(--ease);
}
.tab-btn.active-ir   { background: var(--white); color: var(--rose); }
.tab-btn.active-frag { background: var(--white); color: var(--steel); }
.tab-btn.active-ir::after   { background: var(--rose);  transform: scaleX(1); }
.tab-btn.active-frag::after { background: var(--steel); transform: scaleX(1); }
.tab-btn:not(.active-ir):not(.active-frag):hover { background: var(--white); color: var(--ink); }
.tab-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; opacity: .55; flex-shrink: 0;
}

/* Panels */
.tool-panel { display: none; padding: 1.4rem 1.8rem 1.6rem; }
.tool-panel.active { display: block; }

/* Input grid */
.input-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: .9rem;
  margin-bottom: 1.1rem;
}
.input-group { display: flex; flex-direction: column; gap: .35rem; }
.input-label {
  font-size: .64rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint);
}
.input-field {
  width: 100%; height: 40px; padding: 0 .9rem;
  border: 1.5px solid var(--border-soft); border-radius: var(--radius);
  font-size: .86rem; color: var(--text); background: var(--surface);
  outline: none; -webkit-appearance: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.input-field::placeholder { color: var(--text-faint); font-style: italic; font-size: .8rem; }
.input-field:hover  { background: var(--white); border-color: var(--border); }
.input-field:focus  {
  background: var(--white);
  border-color: var(--ff, var(--rose));
  box-shadow: 0 0 0 3px var(--fr, rgba(125,36,85,.1));
}
#panel-ir   .input-field { --ff: var(--rose);  --fr: rgba(125,36,85,.1); }
#panel-frag .input-field { --ff: var(--steel); --fr: rgba(45,96,112,.12); }

/* Action buttons */
.action-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: 0 1.8rem; height: 44px;
  border: none; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .17em; color: var(--white);
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform .18s var(--ease-bounce), box-shadow .18s;
}
.action-btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,.13);
  transform: translateX(-110%) skewX(-18deg);
  transition: transform .42s var(--ease);
}
.action-btn:hover::before { transform: translateX(110%) skewX(-18deg); }
.action-btn:hover  { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.action-btn:active { transform: translateY(0); }
.btn-ir {
  background: linear-gradient(130deg, var(--rose-dark) 0%, var(--rose) 60%, var(--rose-mid) 100%);
  box-shadow: 0 3px 14px rgba(125,36,85,.28);
}
.btn-frag {
  background: linear-gradient(130deg, var(--steel-dark) 0%, var(--steel) 60%, var(--steel-mid) 100%);
  box-shadow: 0 3px 14px rgba(45,96,112,.28);
}
.btn-icon { font-size: .95rem; }

/* ── Results area — prominent ── */
.results-area {
  margin-top: 1.2rem;
  min-height: 260px;             /* taller so molecules have room */
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  position: relative; overflow: hidden;
  transition: border-color .3s;
}
.results-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 220px; gap: .6rem; color: var(--text-faint);
}
.results-empty-icon { font-size: 2.2rem; opacity: .38; }
.results-empty-text { font-size: .8rem; font-style: italic; text-align: center; }

.results-label {
  font-family: var(--font-mono); font-size: .63rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: .9rem;
}
.results-label strong { color: var(--ink-muted); font-weight: 400; }

/* Result cards — fill width nicely */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .9rem;
}
.result-card {
  background: var(--white);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.1rem .9rem; text-align: center; cursor: pointer;
  transition: box-shadow .2s, transform .2s var(--ease-bounce), border-color .2s;
  animation: cardPop .38s var(--ease-bounce) both;
}
.result-card:nth-child(2) { animation-delay: .07s; }
.result-card:nth-child(3) { animation-delay: .14s; }
.result-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-4px);
  border-color: var(--ch, var(--rose-light));
}
@keyframes cardPop {
  from { opacity:0; transform:scale(.9) translateY(8px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
.card-mol { width: 108px; height: 92px; margin: 0 auto .55rem; }
.card-name { font-size: .83rem; font-weight: 400; color: var(--ink); margin-bottom: .25rem; line-height: 1.3; }
.card-smiles { font-family: var(--font-mono); font-size: .6rem; color: var(--text-faint); margin-bottom: .45rem; }
.card-score {
  display: inline-block; padding: .16rem .6rem;
  border-radius: 999px; font-size: .64rem;
}
.score-rose  { background: var(--rose-pale);  color: var(--rose); }
.score-steel { background: var(--steel-pale); color: var(--steel); }

/* Spinner */
.spinner-wrap { display: flex; align-items: center; justify-content: center; height: 200px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--sc, var(--rose));
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════
   INNER PAGES — shared layout
══════════════════════════ */
.inner-page-body {
  flex: 1; display: flex; flex-direction: column;
  width: 100%; max-width: 920px; margin: 0 auto;
  padding: 2.2rem var(--pad-x) 3.5rem;
}

.section-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .65rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--rose); margin-bottom: .5rem;
}
.section-kicker::before {
  content: ''; display: block;
  width: 20px; height: 1px; background: var(--rose);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 400; font-style: italic; color: var(--ink);
  margin-bottom: 2rem;
}

/* Publications */
.pub-group { margin-bottom: 2.4rem; }
.pub-group-title {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--font-mono); font-size: .67rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .9rem;
}
.pub-group-title::after { content: ''; flex: 1; height: 1px; background: var(--border-soft); }
.pub-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); flex-shrink: 0; }
.pub-dot.steel { background: var(--steel); }
.pub-list { display: flex; flex-direction: column; gap: .6rem; }
.pub-item {
  background: var(--white); border: 1.5px solid var(--border-soft);
  border-left: 3.5px solid transparent; border-radius: var(--radius);
  padding: 1.1rem 1.3rem; font-size: .87rem; line-height: 1.8;
  color: var(--text-muted); cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease), color .2s;
}
.pub-item:hover {
  border-left-color: var(--rose); box-shadow: var(--shadow-xs);
  transform: translateX(4px); color: var(--text);
}
.pub-item.steel:hover { border-left-color: var(--steel); }

/* Tutorials */
.tuts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 1.4rem;
}
.tut-card {
  background: var(--white); border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-xl); overflow: hidden; cursor: pointer;
  transition: box-shadow .25s, transform .25s var(--ease-bounce);
  animation: fadeUp .45s var(--ease-out) both;
}
.tut-card:nth-child(2) { animation-delay: .1s; }
.tut-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-5px); }
.tut-thumb {
  height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tut-thumb-rose  { background: linear-gradient(135deg, var(--rose-dark), var(--rose), var(--rose-mid)); }
.tut-thumb-steel { background: linear-gradient(135deg, var(--steel-dark), var(--steel), var(--steel-mid)); }
.tut-glyph {
  font-size: 3.8rem; filter: drop-shadow(0 4px 16px rgba(0,0,0,.28));
  transition: transform .35s var(--ease-bounce);
}
.tut-card:hover .tut-glyph { transform: scale(1.14) rotate(-6deg); }
.tut-body { padding: 1.2rem 1.3rem; border-top: 1px solid var(--border-soft); }
.tut-label {
  font-family: var(--font-mono); font-size: .67rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-bottom: .35rem;
}
.tut-desc { font-size: .81rem; color: var(--text-muted); line-height: 1.6; }
.tut-badge {
  display: inline-block; margin-top: .7rem;
  padding: .2rem .7rem; border-radius: 999px; font-size: .64rem;
}
.badge-rose  { background: var(--rose-pale);  color: var(--rose); }
.badge-steel { background: var(--steel-pale); color: var(--steel); }

/* About */
.about-list { display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.team-card {
  display: flex; gap: 1.3rem; align-items: flex-start;
  background: var(--white); border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 1.3rem;
  transition: box-shadow .2s, transform .2s var(--ease), border-color .2s;
  animation: fadeUp .4s var(--ease-out) both;
}
.team-card:nth-child(1){animation-delay:.04s}.team-card:nth-child(2){animation-delay:.09s}
.team-card:nth-child(3){animation-delay:.14s}.team-card:nth-child(4){animation-delay:.19s}
.team-card:nth-child(5){animation-delay:.24s}
.team-card:hover { box-shadow: var(--shadow-md); transform: translateX(4px); border-color: var(--border); }
.team-avatar {
  width: 54px; height: 54px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.av-1{background:linear-gradient(135deg,#f0d0e0,#e0b0cc)}
.av-2{background:linear-gradient(135deg,var(--steel-pale),#b8d4e2)}
.av-3{background:linear-gradient(135deg,#ead4e6,#d4b8d4)}
.av-4{background:linear-gradient(135deg,#d4e8f2,#bcd2e4)}
.av-5{background:linear-gradient(135deg,var(--surface-2),#ccd8e4)}
.team-name {
  font-family: var(--font-display); font-size: 1.05rem;
  font-weight: 500; color: var(--ink); margin-bottom: .35rem;
}
.team-bio { font-size: .83rem; line-height: 1.72; color: var(--text-muted); }

/* ── Footer ── */
.site-footer {
  width: 100%; padding: .9rem var(--pad-x);
  background: var(--white); border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; font-size: .7rem; color: var(--text-faint); flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: .45rem;
  font-family: var(--font-mono); letter-spacing: .1em; color: var(--ink-muted);
}
.footer-brand svg { width: 16px; height: 16px; }

/* ══════════════════════════
   RESPONSIVE
══════════════════════════ */
@media (max-width: 860px) {
  .input-grid { grid-template-columns: 1fr 1fr; }
  .input-grid .input-group:first-child { grid-column: 1 / -1; }
  .result-grid { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); }
}
@media (max-width: 600px) {
  :root { --pad-x: 1.1rem; }
  .input-grid { grid-template-columns: 1fr; }
  .nav-links  { display: none; }
  .nav-burger { display: flex; }
  .hero-title { font-size: 2.2rem; }
  .tab-btn { padding: .75rem 1rem; font-size: .62rem; }
  .tool-panel { padding: 1.1rem; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .team-card { flex-direction: column; gap: .8rem; }
  .inner-page-body { padding: 1.8rem 1.1rem 2.5rem; }
}
@media (max-width: 380px) {
  .result-grid { grid-template-columns: 1fr; }
}
