/*-----------------------------------*\
  #pages.css — vCard UI/UX adapted to
  Code Master SK palette & full-screen
\*-----------------------------------*/

:root {
  /* Existing index.html palette */
  --bg: #FFFDF7;
  --cream: #FFF1B8;
  --yellow: #FFE36A;
  --orange: #FF922E;
  --dork: #A94700;
  --ink: #191919;
  --mut: #595347;
  --card: #FFFFFF;
  --soft: #FFF8DF;
  --line: rgba(25, 25, 25, .12);

  /* vCard gradients mapped to existing warm palette */
  --bg-gradient-surface: linear-gradient(135deg, #FFFFFF 0%, #FFFDF7 60%, #FFF8DF 100%);
  --bg-gradient-soft: linear-gradient(135deg, #FFFDF7 0%, #FFF8DF 100%);
  --bg-gradient-accent-1: linear-gradient(to bottom right, #FF922E 0%, rgba(255, 227, 106, 0.35) 60%);
  --bg-gradient-accent-2: linear-gradient(135deg, #FFF1B8 0%, #FFFDF7 70%);
  --border-gradient-warm: linear-gradient(to bottom right, rgba(25, 25, 25, .16) 0%, rgba(25, 25, 25, .05) 60%);
  --text-gradient-accent: linear-gradient(to right, #A94700, #FF922E);

  /* Existing typography */
  --ff-base: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-1: 24px;
  --fs-2: 18px;
  --fs-3: 17px;
  --fs-4: 16px;
  --fs-5: 15px;
  --fs-6: 14px;
  --fs-7: 13px;
  --fs-8: 11px;

  --fw-400: 400;
  --fw-500: 500;
  --fw-600: 600;
  --fw-700: 700;
  --fw-800: 800;

  /* Subtle warm elevation */
  --shadow-1: 0 4px 14px rgba(25, 25, 25, .05);
  --shadow-2: 0 8px 20px rgba(169, 71, 0, .07);

  /* Transitions */
  --transition-1: 0.25s ease;
  --transition-2: 0.5s ease-in-out;
  --pad: clamp(12px, 1.8vw, 22px);
}

/*-----------------------------------*\
  #RESET
\*-----------------------------------*/

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

a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

li { list-style: none; }

img, svg, a, button, time, span { display: block; }

button {
  font: inherit;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

input, textarea, select {
  display: block;
  width: 100%;
  background: none;
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--cream);
  color: var(--ink);
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--dork);
  outline-offset: 2px;
}

html {
  font-family: var(--ff-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  top: -140px;
  right: -60px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 241, 184, .85), transparent 68%);
  pointer-events: none;
  z-index: -1;
}

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ic-fill {
  fill: currentColor;
  stroke: none;
}

/*-----------------------------------*\
  #REUSED STYLE (vCard mechanics)
\*-----------------------------------*/

.sidebar,
article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  z-index: 1;
}

.separator {
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.icon-box {
  position: relative;
  background: var(--border-gradient-warm);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--dork);
  z-index: 1;
  flex: none;
}

.icon-box::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--cream);
  border-radius: inherit;
  z-index: -1;
}

article.active {
  display: flex;
  flex-direction: column;
  animation: fade 0.45s ease backwards;
}

@keyframes fade {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.h2, .h3, .h4, .h5 {
  color: var(--ink);
  letter-spacing: -0.025em;
}

.h2 { font-size: var(--fs-1); font-weight: var(--fw-800); }
.h3 { font-size: var(--fs-2); font-weight: var(--fw-800); }
.h4 { font-size: var(--fs-4); font-weight: var(--fw-700); }
.h5 { font-size: var(--fs-7); font-weight: var(--fw-700); }

.article-title {
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 22px;
  text-wrap: balance;
}

.article-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 4px;
  background: var(--text-gradient-accent);
  border-radius: 4px;
}

.content-card {
  position: relative;
  background: var(--border-gradient-warm);
  padding: 20px;
  border-radius: 14px;
  z-index: 1;
}

.content-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-soft);
  border-radius: inherit;
  z-index: -1;
}

/*-----------------------------------*\
  #MAIN (Full-screen responsive shell)
\*-----------------------------------*/

main {
  width: 100%;
  min-height: 100dvh;
  padding: var(--pad);
  padding-bottom: 84px;
}

.main-content {
  position: relative;
  width: 100%;
  min-width: 0;
}

/*-----------------------------------*\
  #SIDEBAR
\*-----------------------------------*/

.sidebar {
  margin-bottom: 16px;
  max-height: 122px;
  overflow: hidden;
  transition: var(--transition-2);
}

.sidebar.active {
  max-height: 520px;
}

.sidebar-info {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
}

.avatar-box {
  width: 80px;
  height: 80px;
  flex: none;
  padding: 3px;
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--cream);
  border-radius: 20px;
  overflow: hidden;
}

.avatar-box img,
.avatar-box span {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  object-fit: cover;
  object-position: center 18%;
  background: var(--cream);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--dork);
}

.info-content .name {
  color: var(--ink);
  font-size: var(--fs-3);
  font-weight: var(--fw-800);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.info-content .title {
  color: var(--dork);
  background: var(--cream);
  font-size: var(--fs-8);
  font-weight: var(--fw-700);
  width: max-content;
  padding: 4px 12px;
  border-radius: 8px;
}

.info_more-btn {
  position: absolute;
  top: -18px;
  right: -18px;
  border-radius: 0 18px 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--dork);
  background: var(--border-gradient-warm);
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-1);
  z-index: 1;
}

.info_more-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: var(--soft);
  transition: var(--transition-1);
  z-index: -1;
}

.info_more-btn:hover,
.info_more-btn:focus { background: var(--bg-gradient-accent-1); }

.info_more-btn:hover::before,
.info_more-btn:focus::before { background: var(--cream); }

.info_more-btn span { display: none; }

.sidebar.active .info_more-btn svg {
  transform: rotate(180deg);
}

.info_more-btn svg {
  transition: transform var(--transition-1);
}

.sidebar-info_more {
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-2);
}

.sidebar.active .sidebar-info_more {
  opacity: 1;
  visibility: visible;
}

.contacts-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.contact-item {
  min-width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-info {
  max-width: calc(100% - 50px);
  width: calc(100% - 50px);
}

.contact-title {
  color: var(--mut);
  font-size: var(--fs-8);
  font-weight: var(--fw-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.contact-info :is(.contact-link, time, address) {
  color: var(--ink);
  font-size: var(--fs-7);
  font-weight: var(--fw-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-info a.contact-link:hover {
  color: var(--dork);
  text-decoration: underline;
}

.contact-info address { font-style: normal; }

.social-list {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}

.social-item .social-link {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--mut);
  transition: var(--transition-1);
}

.social-item .social-link:hover {
  background: var(--cream);
  border-color: var(--orange);
  color: var(--dork);
  transform: translateY(-2px);
}

.hub-back {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  font-size: var(--fs-7);
  font-weight: var(--fw-700);
  transition: var(--transition-1);
}

.hub-back:hover {
  background: var(--dork);
  color: #FFFFFF;
}

/*-----------------------------------*\
  #NAVBAR (Mobile bottom glass -> Desktop top-right)
\*-----------------------------------*/

.navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 253, 247, 0.88);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 16px rgba(25, 25, 25, .06);
  z-index: 10;
}

.navbar-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
}

.navbar-link {
  color: var(--mut);
  font-size: var(--fs-7);
  font-weight: var(--fw-700);
  padding: 17px 10px;
  transition: color var(--transition-1);
}

.navbar-link:hover,
.navbar-link:focus { color: var(--ink); }

.navbar-link.active { color: var(--dork); }

/*-----------------------------------*\
  #ABOUT & PROSE
\*-----------------------------------*/

.about-text {
  color: #2c2822;
  font-size: var(--fs-5);
  font-weight: var(--fw-400);
  line-height: 1.65;
  margin-bottom: 30px;
  max-width: 74ch;
}

.about-text p {
  margin-bottom: 14px;
  text-wrap: pretty;
}

.about-text p:last-child { margin-bottom: 0; }

.about-text a {
  display: inline;
  color: var(--dork);
  font-weight: var(--fw-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-text ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.about-text li {
  list-style: disc;
  margin-bottom: 7px;
}

.about-text code {
  display: inline;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
}

/* #service */

.service { margin-bottom: 34px; }
.service-title { margin-bottom: 18px; }

.service-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.service-item {
  position: relative;
  background: var(--border-gradient-warm);
  padding: 20px;
  border-radius: 14px;
  z-index: 1;
  transition: transform var(--transition-1);
}

.service-item::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--bg-gradient-soft);
  border-radius: inherit;
  z-index: -1;
}

.service-item:hover {
  transform: translateY(-2px);
  background: var(--bg-gradient-accent-1);
}

.service-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--dork);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  flex: none;
}

.service-content-box { text-align: center; }

.service-item-title { margin-bottom: 6px; }

.service-item-text {
  color: var(--mut);
  font-size: var(--fs-6);
  line-height: 1.55;
}

/*-----------------------------------*\
  #TIMELINE & SKILLS
\*-----------------------------------*/

.timeline { margin-bottom: 34px; }

.timeline .title-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.timeline-list {
  font-size: var(--fs-6);
  margin-left: 44px;
}

.timeline-item { position: relative; }
.timeline-item:not(:last-child) { margin-bottom: 20px; }

.timeline-item-title {
  font-size: var(--fs-5);
  line-height: 1.3;
  margin-bottom: 5px;
}

.timeline-list span {
  color: var(--dork);
  font-weight: var(--fw-700);
  font-size: var(--fs-7);
  line-height: 1.5;
  margin-bottom: 4px;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: -22px;
  left: -26px;
  width: 2px;
  height: calc(100% + 44px);
  background: var(--cream);
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: 5px;
  left: -30px;
  height: 10px;
  width: 10px;
  background: var(--text-gradient-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--cream);
}

.timeline-text {
  color: var(--mut);
  line-height: 1.6;
  max-width: 70ch;
}

/* #skills */

.skill { margin-bottom: 28px; }
.skills-title { margin-bottom: 18px; }

.skills-list {
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.skill .title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.skill .title-wrapper data {
  color: var(--dork);
  font-size: var(--fs-7);
  font-weight: var(--fw-700);
}

.skill-progress-bg {
  background: rgba(25, 25, 25, .09);
  width: 100%;
  height: 8px;
  border-radius: 10px;
  overflow: hidden;
}

.skill-progress-fill {
  background: var(--text-gradient-accent);
  height: 100%;
  border-radius: inherit;
}

/*-----------------------------------*\
  #CONTACT
\*-----------------------------------*/

.mapbox {
  position: relative;
  height: clamp(240px, 34vh, 360px);
  width: 100%;
  border-radius: 16px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--soft);
}

.mapbox figure { height: 100%; }

.mapbox iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.contact-form { margin-bottom: 20px; }
.form-title { margin-bottom: 18px; }

.input-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.form-input {
  color: var(--ink);
  font-size: var(--fs-6);
  font-weight: var(--fw-500);
  padding: 13px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color var(--transition-1), background var(--transition-1);
}

.form-input::placeholder {
  color: var(--mut);
  font-weight: var(--fw-500);
}

.form-input:focus {
  border-color: var(--orange);
  background: #FFFFFF;
}

textarea.form-input {
  min-height: 110px;
  height: 130px;
  max-height: 240px;
  resize: vertical;
  margin-bottom: 20px;
}

.form-input:focus:invalid { border-color: #B42318; }

.form-btn {
  position: relative;
  width: 100%;
  background: var(--border-gradient-warm);
  color: var(--dork);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: var(--fs-6);
  font-weight: var(--fw-800);
  z-index: 1;
  transition: var(--transition-1);
}

.form-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--cream);
  border-radius: inherit;
  z-index: -1;
  transition: var(--transition-1);
}

.form-btn:hover { background: var(--bg-gradient-accent-1); }
.form-btn:hover::before { background: var(--yellow); }

.form-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-btn:disabled:hover { background: var(--border-gradient-warm); }
.form-btn:disabled:hover::before { background: var(--soft); }

.form-note {
  margin-top: 12px;
  font-size: var(--fs-7);
  color: var(--mut);
}

/* Legal pills & headings */
.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.pill-tabs a {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--dork);
  font-size: var(--fs-7);
  font-weight: var(--fw-700);
  transition: var(--transition-1);
}

.pill-tabs a:hover {
  background: var(--cream);
  border-color: var(--orange);
}

.legal-h2 {
  font-size: var(--fs-2);
  font-weight: var(--fw-800);
  margin: 24px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.legal-h2:first-of-type {
  margin-top: 4px;
  padding-top: 0;
  border-top: 0;
}

.legal-h3 {
  font-size: var(--fs-5);
  font-weight: var(--fw-700);
  color: var(--dork);
  margin: 16px 0 6px;
}

/* Footer inside main card */
.card-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: var(--fs-7);
  color: var(--mut);
}

.card-footer b {
  display: inline;
  color: var(--ink);
}

/*-----------------------------------*\
  #RESPONSIVE (Full-screen at every size)
\*-----------------------------------*/

@media (min-width: 580px) {
  :root {
    --fs-1: 30px;
    --fs-2: 22px;
    --fs-3: 22px;
    --fs-4: 17px;
    --fs-6: 15px;
    --fs-7: 14px;
    --fs-8: 12px;
  }

  .sidebar, article { padding: 28px; }

  .article-title { padding-bottom: 14px; }
  .article-title::after { width: 44px; height: 5px; }

  .icon-box { width: 46px; height: 46px; border-radius: 12px; }

  .sidebar { max-height: 172px; margin-bottom: 22px; }
  .sidebar.active { max-height: 600px; }
  .sidebar-info { gap: 22px; }

  .avatar-box { width: 108px; height: 108px; border-radius: 26px; }
  .avatar-box img, .avatar-box span { border-radius: 23px; }

  .info_more-btn { top: -28px; right: -28px; padding: 10px 15px; }
  .info_more-btn span { display: block; font-size: var(--fs-8); }
  .info_more-btn svg { display: none; }

  .separator { margin: 24px 0; }
  .contacts-list { gap: 18px; }
  .contact-info { max-width: calc(100% - 60px); width: calc(100% - 60px); }

  .navbar { border-radius: 20px 20px 0 0; }
  .navbar-list { gap: 18px; }
  .navbar-link { font-size: 14px; }

  .service-item {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
  }
  .service-icon-box { margin: 2px 0 0; }
  .service-content-box { text-align: left; }

  .timeline-list { margin-left: 60px; }
  .timeline-item:not(:last-child)::before { left: -37px; }
  .timeline-item::after { left: -41px; }
}

@media (min-width: 768px) {
  .contacts-list {
    grid-template-columns: 1fr 1fr;
    gap: 22px 16px;
  }

  .navbar-link { font-size: 15px; }
  .input-wrapper { grid-template-columns: 1fr 1fr; }

  .form-btn {
    width: max-content;
    margin-left: auto;
  }

  .skills-list { grid-template-columns: 1fr 1fr; gap: 20px 28px; }
}

@media (min-width: 1024px) {
  main {
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    gap: var(--pad);
    padding: var(--pad);
    min-height: 100dvh;
  }

  .sidebar {
    position: sticky;
    top: var(--pad);
    flex: 0 0 clamp(280px, 23vw, 340px);
    max-height: none;
    min-height: calc(100dvh - (var(--pad) * 2));
    margin-bottom: 0;
    padding: 36px 24px 24px;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .sidebar-info {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .avatar-box {
    width: 136px;
    height: 136px;
    border-radius: 28px;
  }

  .avatar-box img, .avatar-box span { border-radius: 25px; }

  .info-content .name {
    white-space: nowrap;
    text-align: center;
  }

  .info-content .title { margin: auto; }
  .info_more-btn { display: none; }

  .sidebar-info_more {
    opacity: 1;
    visibility: visible;
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .contacts-list { grid-template-columns: 1fr; }
  .social-list { justify-content: center; }
  .hub-back { margin-top: auto; }

  .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  article.active {
    flex: 1;
    min-height: calc(100dvh - (var(--pad) * 2));
    padding: 34px clamp(26px, 3vw, 40px);
  }

  .navbar {
    position: absolute;
    bottom: auto;
    top: 0;
    left: auto;
    right: 0;
    width: max-content;
    border-top: 0;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0 20px 0 20px;
    padding: 0 20px;
    box-shadow: none;
    background: var(--soft);
  }

  .navbar-list {
    gap: 24px;
    padding: 0 12px;
  }

  .article-title { padding-right: 320px; }

  .service-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
