/* ============================================================
   PORTFOLIO — DANYLO FEDKIV
   Design tokens: cobalt academic palette, Inter, monospace labels
   ============================================================ */

/* ── TOKENS ── */
:root {
  --bg:          #ffffff;
  --bg-alt:      #f7f7f8;
  --text:        #1a1a1a;
  --text-mid:    #4a4a4a;
  --text-light:  #8a8a8a;
  --accent:      #3b6fa0;
  --accent-dim:  #d6e4f0;
  --rule:        #e2e2e5;
  --green:       #2e7d53;
  --amber:       #a06c20;
  --gray-dot:    #b0b0b8;
  --placeholder: #b8b8c0;
  --mono:        "Courier New", Courier, monospace;
  --sans:        "Inter", system-ui, -apple-system, sans-serif;
  --nav-h:       56px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── PLACEHOLDER STYLE ── */
.placeholder-text { color: var(--placeholder); font-style: italic; }

/* ── NAV ── */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  height: var(--nav-h);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-logo {
  font-family: var(--mono);
  font-size: .9rem;
  letter-spacing: .08em;
  color: var(--accent);
  flex-shrink: 0;
}
.nav-tabs {
  display: flex;
  gap: .25rem;
  margin-left: auto;
  list-style: none;
}
.tab-btn {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--text-mid);
  cursor: pointer;
  padding: .35rem .85rem;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: auto;
  color: var(--text);
}

/* ── TAB PANELS ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── LAYOUT ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section { padding: 4.5rem 0; }

/* ── TYPE ATOMS ── */
.section-eyebrow {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.section-subtitle {
  font-size: 1rem;
  color: var(--text-mid);
  margin-bottom: 2.5rem;
  max-width: 56ch;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .04em;
  padding: .5rem 1.1rem;
  border: 1.5px solid var(--accent);
  transition: background .2s, color .2s;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary:hover { background: #2a5480; border-color: #2a5480; }
.btn-link {
  display: inline-block;
  font-size: .85rem;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color .2s;
}
.btn-link:hover { border-color: var(--accent); }

/* ── FADE-IN ── */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .45s ease, transform .45s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
}

/* ══════════════════════════════════════
   ABOUT
══════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.about-name {
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: .9rem;
}
.about-tagline {
  font-size: 1rem;
  color: var(--text-mid);
  max-width: 58ch;
  margin-bottom: 1.6rem;
  line-height: 1.7;
}
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  margin-bottom: 2.4rem;
  align-items: center;
}
.highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.highlight-item { display: flex; flex-direction: column; }
.highlight-val { font-size: .9rem; font-weight: 600; }
.highlight-label {
  font-size: .78rem;
  color: var(--text-light);
  font-family: var(--mono);
  margin-top: .1rem;
}
.about-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-block {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  padding: 1rem 1.1rem;
}
.sidebar-title {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: .6rem;
}
.sidebar-text { font-size: .86rem; color: var(--text-mid); line-height: 1.55; }
.interest-list li, .status-list li {
  font-size: .84rem;
  color: var(--text-mid);
  padding: .22rem 0;
  border-bottom: 1px solid var(--rule);
}
.interest-list li:last-child, .status-list li:last-child { border-bottom: none; }
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: .45rem;
  vertical-align: middle;
  margin-bottom: 1px;
}
.dot.green  { background: var(--green); }
.dot.amber  { background: var(--amber); }
.dot.gray   { background: var(--gray-dot); }

/* ══════════════════════════════════════
   PROJECTS
══════════════════════════════════════ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.project-card {
  border: 1px solid var(--rule);
  padding: 1.3rem 1.2rem 1.1rem;
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(59,111,160,.08);
}
.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .7rem;
}
.project-status {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .15rem .45rem;
}
.project-status.ongoing  { color: var(--amber); border: 1px solid var(--amber); }
.project-status.completed { color: var(--green); border: 1px solid var(--green); }
.project-tag {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-light);
  letter-spacing: .05em;
}
.project-title { font-size: .98rem; font-weight: 600; margin-bottom: .55rem; line-height: 1.35; }
.project-desc { font-size: .84rem; color: var(--text-mid); line-height: 1.6; flex: 1; margin-bottom: .8rem; }
.project-lab {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  margin-top: auto;
  padding-top: .7rem;
  border-top: 1px solid var(--rule);
}

/* ══════════════════════════════════════
   BLOG
══════════════════════════════════════ */
.blog-list { display: flex; flex-direction: column; }
.blog-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background .15s;
}
.blog-item:first-child { border-top: 1px solid var(--rule); }
.blog-item:hover .blog-title { color: var(--accent); }
.blog-date {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--text-light);
  padding-top: .25rem;
  line-height: 1.4;
}
.blog-title { font-size: .98rem; font-weight: 600; margin-bottom: .3rem; transition: color .2s; }
.blog-excerpt { font-size: .85rem; color: var(--text-mid); line-height: 1.55; }
.blog-read-more {
  font-size: .78rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-top: .4rem;
  display: inline-block;
}
.blog-empty {
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.blog-empty p { font-size: .9rem; }

/* MODAL */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  cursor: pointer;
}
.modal-box {
  position: relative;
  background: var(--bg);
  max-width: 700px;
  width: 100%;
  padding: 2.5rem 2rem;
  border: 1px solid var(--rule);
  z-index: 1;
  animation: modalIn .2s ease;
  margin: auto;
}
@keyframes modalIn {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  font-size: .9rem;
  color: var(--text-light);
  cursor: pointer;
  padding: .25rem .5rem;
}
.modal-close:hover { color: var(--text); }
.modal-content h2 { font-size: 1.3rem; margin-bottom: .5rem; }
.modal-content .modal-meta {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.modal-content p { font-size: .92rem; color: var(--text-mid); margin-bottom: 1rem; line-height: 1.7; }
.modal-content h3 { font-size: 1rem; font-weight: 600; margin: 1.3rem 0 .5rem; }
.modal-content ul { padding-left: 1.2rem; list-style: disc; margin-bottom: 1rem; }
.modal-content li { font-size: .9rem; color: var(--text-mid); line-height: 1.6; margin-bottom: .3rem; }

/* ══════════════════════════════════════
   FUN
══════════════════════════════════════ */
.comics-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1.5px solid var(--accent);
  padding: 1.2rem 1.4rem;
  margin-bottom: 2.5rem;
  background: var(--accent-dim);
  flex-wrap: wrap;
}
.comics-callout-left { display: flex; align-items: center; gap: 1rem; }
.comics-icon { font-size: 1.6rem; flex-shrink: 0; }
.comics-label { font-size: .95rem; font-weight: 600; margin-bottom: .15rem; }
.comics-sub { font-size: .82rem; color: var(--text-mid); }

.fun-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}
.fun-card {
  border: 1px solid var(--rule);
  padding: 1rem;
  background: var(--bg);
  transition: border-color .2s;
}
.fun-card:hover { border-color: var(--accent); }
.fun-img-placeholder {
  background: var(--bg-alt);
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
  font-size: 2rem;
}
.fun-caption { font-size: .8rem; color: var(--text-mid); line-height: 1.5; }

/* ══════════════════════════════════════
   COMICS PAGE
══════════════════════════════════════ */
body.comics-page { background: var(--bg-alt); }

.comics-header {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.comics-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.comics-page-title {
  font-size: 1.4rem;
  font-weight: 600;
}

.comics-main {
  padding: 3rem 1.5rem;
}

/* 1-column comic feed */
#comics-feed {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.comic-entry {
  background: var(--bg);
  border: 1px solid var(--rule);
  overflow: hidden;
  transition: box-shadow .2s;
}
.comic-entry:hover {
  box-shadow: 0 3px 16px rgba(59,111,160,.1);
}
.comic-img-wrap {
  width: 100%;
  background: #f0f0f2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.comic-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.comic-caption {
  padding: .9rem 1.1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.comic-title {
  font-size: .9rem;
  font-weight: 600;
}
.comic-num {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.comics-empty-state {
  max-width: 500px;
  margin: 3rem auto;
  text-align: center;
  padding: 2.5rem;
  border: 1px dashed var(--rule);
  background: var(--bg);
}
.comics-empty-state p { font-size: .9rem; color: var(--text-mid); margin-bottom: .5rem; }
.comics-empty-hint { font-size: .82rem; color: var(--text-light); }
.comics-empty-hint code {
  font-family: var(--mono);
  background: var(--bg-alt);
  padding: .1em .3em;
  font-size: .8em;
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  text-align: center;
}
.site-footer p { font-size: .83rem; color: var(--text-light); line-height: 1.7; }
.site-footer a { color: var(--accent); }
.footer-small { font-family: var(--mono); font-size: .72rem; margin-top: .25rem; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-sidebar { flex-direction: row; flex-wrap: wrap; }
  .sidebar-block { flex: 1 1 200px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .fun-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .section { padding: 3rem 0; }
  .about-name { font-size: 1.85rem; }
  .section-title { font-size: 1.4rem; }
  .nav-tabs { display: none; flex-direction: column; gap: 0; }
  .nav-tabs.open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: .5rem 0;
    z-index: 99;
  }
  .nav-tabs.open .tab-btn {
    width: 100%;
    text-align: left;
    padding: .65rem 1.5rem;
    border-bottom: none;
    border-left: 2px solid transparent;
  }
  .nav-tabs.open .tab-btn.active { border-left-color: var(--accent); }
  .nav-toggle { display: block; }
  .project-grid { grid-template-columns: 1fr; }
  .fun-grid { grid-template-columns: 1fr 1fr; }
  .highlights { grid-template-columns: 1fr; }
  .blog-item { grid-template-columns: 70px 1fr; }
  .modal-box { padding: 1.5rem 1.1rem; }
  .comics-callout { flex-direction: column; align-items: flex-start; }
}
