:root {
  --bg-page: #111315;
  --bg-surface: #1b1f24;
  --bg-elevated: #20252b;
  --bg-nav: rgba(17, 19, 21, 0.9);
  --bg-accent: #4f7ea8;
  --bg-accent-hover: #5a8bb6;
  --bg-accent-active: #456d90;
  --text-primary: #f3f4f6;
  --text-secondary: #b3bcc8;
  --text-soft: #93a0af;
  --border-color: #2b3138;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.22);
  --radius-card: 18px;
  --radius-button: 12px;
  --space-section: clamp(4.5rem, 8vw, 6rem);
  --space-card: clamp(1.75rem, 3vw, 2.25rem);
  --space-grid: clamp(1.5rem, 3vw, 2rem);
  --space-text: 1rem;
}

html {
  scroll-behavior: smooth;
}

body,
input,
textarea,
select {
  color: var(--text-primary);
}

body {
  background: var(--bg-page);
}

body,
input,
textarea,
select,
.button {
  font-family: "Open Sans", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
b,
strong {
  color: var(--text-primary);
}

p,
ul,
ol,
dl,
table {
  margin-bottom: var(--space-text);
}

header {
  margin: 0 0 1.5rem;
}

header > p,
footer > p,
.hero-subtitle,
.hero-tagline,
.stat-card span,
.timeline-list span,
#copyright {
  color: var(--text-secondary);
}

a {
  color: var(--bg-accent);
}

a:hover {
  color: var(--bg-accent-hover) !important;
}

#nav {
  background: var(--bg-nav);
  border-bottom: 1px solid rgba(43, 49, 56, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

#nav ul.container {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

#nav li {
  margin: 0;
}

#nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0 1rem;
}

#nav a:hover,
#nav a.active {
  background: rgba(79, 126, 168, 0.12);
  border-color: rgba(79, 126, 168, 0.35);
  color: var(--text-primary) !important;
}

#nav a.active:before {
  display: none;
}

.wrapper {
  background-image: none;
  box-shadow: none;
  padding: var(--space-section) 0;
}

.wrapper.style1 {
  background: linear-gradient(180deg, #14171a 0%, #111315 100%);
}

.wrapper.style2,
.wrapper.style3,
.wrapper.style4 {
  background: var(--bg-page);
  text-shadow: none;
}

.container {
  width: 1160px;
}

.row {
  margin-top: calc(var(--space-grid) * -1);
  margin-left: calc(var(--space-grid) * -1);
}

.row > * {
  padding: var(--space-grid) 0 0 var(--space-grid);
}

.hero-row {
  row-gap: 2rem;
}

#top {
  padding-top: clamp(5rem, 9vw, 6.5rem);
}

#top header {
  margin-bottom: 0.75rem;
}

#top h1 {
  font-size: clamp(2.85rem, 5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 0.2rem;
}

#top .profile-photo {
  border: 1px solid rgba(79, 126, 168, 0.18);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

#top .image.profile-photo,
#top .image.profile-photo img {
  background: var(--bg-surface);
}

#top .hero-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

#top .hero-tagline {
  color: var(--text-primary);
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

#top p:last-of-type {
  color: var(--text-secondary);
  max-width: 48rem;
}

.hero-actions {
  margin-top: 1.5rem;
}

ul.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
}

ul.actions li {
  margin: 0;
  padding-left: 0;
}

input[type="button"],
input[type="submit"],
input[type="reset"],
button,
.button {
  background-image: none;
  background: var(--bg-accent);
  border: 1px solid rgba(125, 165, 198, 0.3);
  border-radius: var(--radius-button);
  box-shadow: none;
  color: var(--text-primary) !important;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  max-width: none;
  padding: 0.95rem 1.5rem;
  text-shadow: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

input[type="button"].large,
input[type="submit"].large,
input[type="reset"].large,
button.large,
.button.large {
  font-size: 1rem;
}

input[type="button"].alt,
input[type="submit"].alt,
input[type="reset"].alt,
button.alt,
.button.alt {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-secondary) !important;
}

input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
button:hover,
.button:hover {
  background: var(--bg-accent-hover);
  border-color: rgba(125, 165, 198, 0.45);
  transform: translateY(-1px);
}

input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
button:active,
.button:active {
  background: var(--bg-accent-active);
  top: 0;
  transform: translateY(0);
}

input[type="button"].alt:hover,
input[type="submit"].alt:hover,
input[type="reset"].alt:hover,
button.alt:hover,
.button.alt:hover {
  background: var(--bg-elevated);
  border-color: #39414a;
  color: var(--text-primary) !important;
}

.box,
.box.style1,
.box.style2 {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: none;
  padding: var(--space-card);
}

.box:hover {
  box-shadow: none;
  transform: none;
}

.box.style1,
.box.style2,
.detail-card,
.project-card,
.compact-card,
.stat-card,
.emphasis-card,
.architecture-box {
  height: 100%;
}

.project-card,
.compact-card,
.stat-card,
.emphasis-card {
  background: var(--bg-elevated);
}

.text-left,
.text-left h3,
.text-left p,
.text-left li {
  text-align: left;
}

.narrative-box p:last-child,
.detail-card .list-bulleted,
.project-card p,
.compact-card p,
.architecture-box .architecture-diagram,
.timeline-list,
.site-footer #copyright {
  margin-bottom: 0;
}

.narrative-box p,
.project-card p,
.compact-card p,
.timeline-list li,
.list-bulleted li {
  color: var(--text-secondary);
}

.list-bulleted {
  list-style: disc;
  list-style-position: outside;
  margin: 0;
  padding-left: 1.25rem;
}

.list-bulleted li {
  margin-bottom: 0.75rem;
}

.list-bulleted li:last-child {
  margin-bottom: 0;
}

.stats-grid {
  margin-top: 0.5rem;
}

.content-row-gap {
  margin-top: clamp(1rem, 2vw, 1.5rem);
}

.stat-card strong {
  color: var(--text-primary);
  display: block;
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.emphasis-card {
  background: linear-gradient(180deg, rgba(79, 126, 168, 0.18) 0%, rgba(32, 37, 43, 0.92) 100%);
}

.architecture-diagram {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  list-style: none;
  padding: 0;
}

.architecture-diagram li {
  background: rgba(17, 19, 21, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  color: var(--text-secondary);
  padding: 1rem 0.9rem;
  text-align: center;
}

.timeline-list {
  list-style: none;
  padding: 0;
}

.timeline-list li {
  border-left: 3px solid var(--bg-accent);
  margin-bottom: 1.25rem;
  padding: 0.15rem 0 0.15rem 1.1rem;
}

.timeline-list li:last-child {
  margin-bottom: 0;
}

.timeline-list span {
  display: inline-block;
  font-weight: 700;
  margin-left: 0.4rem;
}

.site-footer {
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  padding-top: 1.5rem;
}

#copyright {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  list-style: none;
  padding-left: 0;
}

#copyright li {
  border: 0;
  box-shadow: none;
  display: block;
  margin: 0;
  padding: 0;
}

@media screen and (max-width: 980px) {
  .container {
    width: 100%;
  }

  .architecture-diagram {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media screen and (max-width: 736px) {
  body {
    padding-top: 44px;
  }

  #nav ul.container {
    gap: 0.1rem;
    justify-content: space-between;
  }

  #nav a {
    font-size: 0.82rem;
    padding: 0 0.55rem;
  }

  .wrapper,
  #top {
    padding: 3.75rem 0;
  }

  #top .hero-subtitle {
    font-size: 0.92rem;
  }

  #top .hero-tagline {
    font-size: 1.08rem;
  }

  ul.actions {
    flex-direction: column;
  }

  ul.actions li,
  .button {
    width: 100%;
  }

  .architecture-diagram {
    grid-template-columns: 1fr;
  }

  .timeline-list span {
    display: block;
    margin-left: 0;
  }
}
