/* Look and feel of the former Hugo "Toha" theme, rebuilt without dependencies.
   Colors follow Toha's palette (Tailwind slate/cyan). */

@font-face { font-family: 'Mulish'; font-style: normal; font-display: swap; font-weight: 400; src: url('/assets/fonts/mulish-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-display: swap; font-weight: 500; src: url('/assets/fonts/mulish-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-display: swap; font-weight: 600; src: url('/assets/fonts/mulish-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-display: swap; font-weight: 700; src: url('/assets/fonts/mulish-latin-700-normal.woff2') format('woff2'); }

:root {
  --accent: #0891b2;
  --accent-hover: #06b6d4;
  --text-over-accent: #e4e4e7;
  --bg-primary: #f8fafc;
  --bg-secondary: #e2e8f0;
  --bg-card: #fff;
  --heading: #1e293b;
  --text: #334155;
  --inverse-text: #cbd5e1;
  --muted: #64748b;
  --footer: #0f172a;
  --footer-heading: #cbd5e1;
  --btn-dark-bg: #334155;
  --btn-dark-hover: #0891b2;
  --badge-bg: #0891b2;
  --badge-text: #e4e4e7;
  --badge-border: #0891b2;
  --ring-inner-bg: #334155;
  --ring-inner-text: #f8fafc;
  --card-border: rgba(0, 0, 0, 0.175);
  --shadow: 0 8px 56px rgba(15, 80, 100, 0.16);
  --navbar-height: 56px;
}

html[data-theme='dark'] {
  --bg-primary: #1f2937;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --heading: #f1f5f9;
  --text: #cbd5e1;
  --inverse-text: #0f172a;
  --muted: #95aed1;
  --footer-heading: #f1f5f9;
  --btn-dark-bg: #0891b2;
  --btn-dark-hover: #06b6d4;
  --badge-bg: #1e293b;
  --badge-text: #cbd5e1;
  --badge-border: #95aed1;
  --ring-inner-bg: #0f172a;
  --ring-inner-text: #cbd5e1;
  --card-border: rgba(255, 255, 255, 0.15);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--navbar-height); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

h1, h3, h5, h6 { margin: 0 0 0.5rem; font-weight: 500; line-height: 1.2; color: var(--heading); }
h1 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; transition: color 0.3s ease-out; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid currentColor; opacity: 0.25; margin: 1rem 0; }
[hidden] { display: none !important; }

.sprite { display: none; }
.icon { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.125em; }
.text-muted { color: var(--muted); }
.text-justify { text-align: justify; }
.text-center { text-align: center; }
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100000; padding: 0.5rem 1rem; background: var(--bg-card); }
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.container { width: 100%; margin: 0 auto; padding: 0 12px; }
@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font: inherit;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.3s ease-out, border-color 0.3s ease-out, color 0.3s ease-out;
}
.btn-dark { background-color: var(--btn-dark-bg); border-color: var(--btn-dark-bg); color: var(--text-over-accent); }
.btn-dark:hover, .btn-dark:focus-visible, .btn-dark[aria-pressed='true'] { background-color: var(--btn-dark-hover); border-color: var(--btn-dark-hover); color: var(--text-over-accent); }
.btn-outline { color: var(--accent); border-color: var(--accent); background: transparent; }
.btn-outline:hover { color: var(--text-over-accent); background-color: var(--accent); }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.btn-link:hover { color: var(--accent-hover); }

/* ---- Navbar ----------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background-color: var(--bg-primary);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease-out, box-shadow 0.3s ease-out;
}
.navbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 12px;
  min-height: var(--navbar-height);
}
.navbar-brand { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 1.25rem; font-weight: 600; color: var(--heading); }
.navbar-brand:hover { color: var(--heading); }
.navbar-brand img { width: 42px; height: 42px; padding: 5px; margin-left: -10px; }
.navbar-toggler { display: none; background: none; border: 0; padding: 0.25rem 0.5rem; font-size: 1.5rem; color: var(--text); cursor: pointer; }
.nav { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: block;
  padding: 0.5rem;
  font: inherit;
  font-weight: 500;
  color: var(--heading);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease-out;
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(8, 145, 178, 0.1);
}
.navbar.is-transparent { background-color: transparent; box-shadow: none; }
.navbar.is-transparent .navbar-brand,
.navbar.is-transparent .nav-link,
.navbar.is-transparent .navbar-toggler { color: #cbd5e1; }
.navbar.is-transparent .nav-link:hover, .navbar.is-transparent .nav-link.active { color: var(--accent); }

.theme-selector { position: relative; }
.dropdown-toggle::after {
  content: '';
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-left: 0.3em solid transparent;
}
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 3rem;
  padding: 0.5rem 0;
  background: var(--bg-card);
  border: 1px solid rgba(8, 145, 178, 0.1);
  border-radius: 0.375rem;
  box-shadow: var(--shadow);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}
.dropdown-menu.show { visibility: visible; opacity: 1; }
.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 0.35rem 1rem;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--heading);
  font-size: 1.1rem;
  cursor: pointer;
}
.dropdown-menu button:hover, .dropdown-menu button[aria-checked='true'] { color: var(--accent); background: rgba(8, 145, 178, 0.1); }
.dropdown-menu button:hover { border-bottom-color: var(--accent); }

@media (max-width: 1199.98px) {
  .navbar-toggler { display: block; }
  .navbar-collapse { display: none; flex-basis: 100%; }
  .navbar.is-open .navbar-collapse { display: block; padding: 0 0 0.75rem 1rem; }
  .nav { flex-direction: column; align-items: stretch; }
  .nav-link { width: 100%; text-align: left; }
  .theme-selector .dropdown-toggle { width: auto; }
  .dropdown-menu { position: static; display: none; box-shadow: none; text-align: center; }
  .dropdown-menu.show { display: flex; }
}

/* ---- Home / hero ------------------------------------------------------ */
.home { position: relative; height: 100vh; min-height: 480px; overflow: hidden; color: var(--text-over-accent); }
.home-background {
  position: absolute;
  inset: 0;
  background: #111 url('/assets/img/background-1280.jpg') center / cover no-repeat;
  background-attachment: fixed;
  transform: scale(1.1);
  filter: blur(3px);
}
@media (min-width: 1281px) { .home-background { background-image: url('/assets/img/background-1920.jpg'); } }
/* iOS blows up fixed backgrounds; keep them scrolling there. */
@supports (-webkit-touch-callout: none) { .home-background { background-attachment: scroll; } }
.home-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1rem 4rem;
}
.avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  padding: 5px;
  margin-bottom: 10px;
  background-color: var(--bg-secondary);
}
.greeting { color: var(--text-over-accent); }
.typing-carousel { font-size: 14pt; min-height: 1.6em; margin: 0; color: var(--text-over-accent); }
.typed-cursor { margin-left: 2px; animation: blink 0.8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.arrow-down {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  margin-left: -0.75rem;
  font-size: 1.5rem;
  color: var(--text-over-accent);
  animation: bounce 2s infinite;
}
.arrow-down:hover { color: var(--text-over-accent); }
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-30px); }
  60% { transform: translateY(-15px); }
}
@media (prefers-reduced-motion: reduce) {
  .arrow-down, .typed-cursor { animation: none; }
}
@media (max-width: 640px) {
  .avatar { width: 140px; height: 140px; }
  .greeting { font-size: 24pt; }
}

/* ---- Sections --------------------------------------------------------- */
.section { padding: 3.5rem 0 3rem; }
.section-title { text-align: center; margin-bottom: 1.5rem; }
@media (max-width: 1024px) { .section-title { font-size: 2.2rem; } }

/* About */
.about-section { display: grid; grid-template-columns: 1fr; gap: 2.5rem; padding-top: 1rem; padding-bottom: 1rem; }
@media (min-width: 576px) { .about-section { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
@media (min-width: 992px) { .about-section { padding: 1.5rem 3rem; } }
.about-text h3, .about-text h5, .about-text p { padding: 0.25rem; }
.social-links { display: flex; flex-wrap: wrap; list-style: none; padding: 0.2rem; margin: 0 0 0.5rem; }
.social-links a { display: inline-block; padding: 0.5rem; font-size: 1.5rem; color: var(--text); }
.social-links a:hover { color: var(--accent); }

.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; align-content: start; }
@media (min-width: 992px) { .badges { grid-template-columns: repeat(3, 1fr); } }
.ring { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bar {
  fill: none;
  stroke-width: 12;
  stroke: var(--ring-color);
  stroke-dashoffset: 433.54;
  transition: stroke-dashoffset 1.8s ease-out 0.3s;
}
.badges.is-visible .ring-bar { stroke-dashoffset: var(--ring-offset); }
.ring > span {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border-radius: 50%;
  text-align: center;
  line-height: 1.25;
  color: var(--ring-inner-text);
  background: var(--ring-inner-bg);
}
.ring[data-color='yellow'] { --ring-color: #eebb4d; }
.ring[data-color='green']  { --ring-color: #2dca73; }
.ring[data-color='blue']   { --ring-color: #048dff; }
.ring[data-color='orange'] { --ring-color: #ff7c7c; }
.ring[data-color='pink']   { --ring-color: #ed63d2; }
.ring[data-color='teal']   { --ring-color: #00adb5; }
.certificate-badge { display: flex; align-items: center; justify-content: center; }
.certificate-badge img { width: 150px; height: auto; }
@media (max-width: 767.98px) { .ring { width: 135px; height: 135px; } }
@media (max-width: 640px) { .ring { width: 150px; height: 150px; } }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 0.375rem;
  overflow: hidden;
  transition: box-shadow 0.3s ease-out, border-color 0.3s ease-out;
}
.card:hover { box-shadow: var(--shadow); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 576px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767.98px) { .skills-grid { max-width: 95%; } }
.skill-card .card-head {
  display: flex;
  align-items: flex-start;
  padding: 0.7rem 0.7rem 0;
  background: var(--bg-primary);
  border-bottom: 1px solid rgba(8, 145, 178, 0.4);
}
html[data-theme='dark'] .skill-card .card-head { background: var(--bg-card); }
.skill-card .card-head img { width: 24px; height: 24px; margin: 0 0.5rem 0.75rem 0; }
.skill-card .card-head h5 { margin: 0; }
.skill-card p { padding: 0.75rem 0.7rem 0.25rem; margin-bottom: 0.75rem; }

/* Experiences timeline (snake line alternating left/right) */
.timeline { --side: 16.6667%; --line: 3px; --radius: 15px; margin-top: 1.5rem; text-align: justify; }
.tl-entry { position: relative; display: grid; grid-template-columns: var(--side) 1fr var(--side); }
.tl-side { position: relative; display: flex; justify-content: center; }
.tl-side::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: calc(50% - var(--line) / 2);
  border-left: var(--line) solid var(--accent);
}
.tl-entry:first-child .tl-side::after { top: 25px; }
.tl-circle {
  position: relative;
  z-index: 1;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: var(--text-over-accent);
  background-color: var(--accent);
}
.tl-body { grid-column: 2; grid-row: 1; }
.tl-left .tl-side { grid-column: 1; grid-row: 1; }
.tl-right .tl-side { grid-column: 3; grid-row: 1; }
.tl-connector { position: relative; height: 40px; }
.tl-connector::before, .tl-connector::after { content: ''; position: absolute; width: calc(41.6667% + var(--line) / 2); height: calc(50% + var(--line) / 2); }
.tl-connector::before { top: 0; }
.tl-connector::after { bottom: 0; }
/* Line comes down on the left, runs right, continues down on the right. */
.tl-to-right::before {
  left: calc(8.3333% - var(--line) / 2);
  border-left: var(--line) solid var(--accent);
  border-bottom: var(--line) solid var(--accent);
  border-bottom-left-radius: var(--radius);
}
.tl-to-right::after {
  left: 50%;
  border-top: var(--line) solid var(--accent);
  border-right: var(--line) solid var(--accent);
  border-top-right-radius: var(--radius);
}
/* Mirror image: down on the right, runs left, continues down on the left. */
.tl-to-left::before {
  left: 50%;
  border-right: var(--line) solid var(--accent);
  border-bottom: var(--line) solid var(--accent);
  border-bottom-right-radius: var(--radius);
}
.tl-to-left::after {
  left: calc(8.3333% - var(--line) / 2);
  border-left: var(--line) solid var(--accent);
  border-top: var(--line) solid var(--accent);
  border-top-left-radius: var(--radius);
}
.company-heading h5 { display: inline; margin-right: 0.4em; }
.company-heading .text-muted { display: inline; }
.company-heading + .text-muted, .location { margin: 0.25rem 0 1rem; }
.designation { font-weight: 600; }
.position .company-heading { margin-top: 1rem; }
.text-heading { margin: 0 0 0.5rem; color: var(--muted); font-weight: 700; font-size: 1rem; }
.timeline ul { padding-left: 1rem; }
.timeline li { color: var(--text); }
@media (max-width: 1199.98px) { .timeline { --side: 8.3333%; } .tl-connector::before, .tl-connector::after { width: calc(45.8333% + var(--line) / 2); } .tl-to-right::before, .tl-to-left::after { left: calc(4.1667% - var(--line) / 2); } }
@media (max-width: 640px) {
  .timeline { text-align: left; }
  .tl-entry { display: block; }
  .tl-side, .tl-connector { display: none; }
  .tl-entry + .tl-connector + .tl-entry { margin-top: 2rem; }
}

/* Education */
.education-list { display: flex; flex-direction: column; gap: 1rem; }
.edu-entry { position: relative; display: grid; grid-template-columns: 2rem 5% 1fr; align-items: center; }
.edu-icon { position: relative; grid-column: 1; align-self: stretch; display: flex; align-items: center; }
/* Vertical line connecting the icons, running from first to last icon. */
.edu-icon::before { content: ''; position: absolute; left: calc(1rem - 1px); width: 2px; top: -0.5rem; bottom: -0.5rem; background: var(--accent); }
.edu-entry:first-child .edu-icon::before { top: 50%; }
.edu-entry:last-child .edu-icon::before { bottom: 50%; }
/* Horizontal stub from the icon to the card. */
.edu-entry::before { content: ''; position: absolute; left: 1rem; top: calc(50% - 1px); width: calc(1rem + 5%); height: 2px; background: var(--accent); }
.edu-icon-holder {
  position: relative;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.95rem;
  color: var(--text-over-accent);
  background-color: var(--accent);
}
.degree-info {
  grid-column: 3;
  padding: 1rem;
  border: 1px solid var(--bg-primary);
  border-left: 2px solid var(--accent);
  border-radius: 5px;
}
.degree-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.degree-head h5 { margin-bottom: 0.3rem; color: var(--accent); }
.degree-info > h6 { font-weight: 400; color: var(--text); }
html[data-theme='dark'] .degree-info > h6 { color: var(--heading); }
.timeframe { color: var(--muted); }
.taken-courses { margin-top: 1rem; }
.taken-courses ul { margin-bottom: 0; }
.taken-courses .hidden-course { display: none; }
.taken-courses.show-all .hidden-course { display: list-item; }
.show-more-btn { margin-left: 1.3rem; }
@media (max-width: 640px) {
  .edu-entry { display: block; }
  .edu-entry::before, .edu-icon { display: none; }
}

/* Publications */
.btn-group { display: flex; flex-wrap: wrap; justify-content: center; margin-bottom: 1.5rem; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-top-left-radius: 0.375rem; border-bottom-left-radius: 0.375rem; }
.btn-group .btn:last-child { border-top-right-radius: 0.375rem; border-bottom-right-radius: 0.375rem; }
.publication-list { display: flex; flex-direction: column; gap: 2rem; }
@media (min-width: 1200px) { .publication-list { padding: 0 0 1rem; } }
.publication { border-top: 2px solid var(--accent); }
.pub-header { padding: 0.5rem 1rem; }
.pub-title { margin: 0; }
.sub-title { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.4rem; font-size: 0.875rem; color: var(--muted); }
.sub-title a { text-decoration: underline; }
.authors { display: flex; flex-wrap: wrap; column-gap: 0.75rem; color: var(--heading); }
html[data-theme='dark'] .authors { color: var(--text); }
.pub-summary { padding: 0 1rem; margin-bottom: 1rem; }
.pub-footer { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 0.5rem; padding: 0 1rem 0.8rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-left: 0.25rem; }
.badge {
  display: inline-block;
  padding: 0.25rem;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  border-radius: 0.375rem;
  color: var(--badge-text);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
}
@media (max-width: 640px) { .pub-footer .btn { margin-left: auto; } }

/* ---- Footer ----------------------------------------------------------- */
.footer { color: var(--muted); background-color: var(--footer); padding: 3rem 0 0.5rem; }
.footer h5 { color: var(--footer-heading); }
.footer-columns { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .footer-columns { grid-template-columns: repeat(3, 1fr); } }
.footer ul { list-style: none; padding: 0; }
.footer li { margin-top: 5px; }
.footer a { color: var(--muted); transition: all 0.3s ease-out; }
.footer a:hover { margin-left: 5px; text-decoration: underline; }
.footer hr { margin: 1rem 12px; color: var(--muted); opacity: 0.4; }
.footer-bottom { text-align: center; }

/* ---- 404 -------------------------------------------------------------- */
.not-found { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; padding: 2rem; }
.not-found .code { font-size: 6rem; font-weight: 700; color: var(--accent); line-height: 1; }
