/* ============================================
   SiliconRust — Core Stylesheet
   Namespace: sr-
   ============================================ */

/* Color & Motion Tokens */
:root {
  --sr-primary: #c66a3a; /* warm rust accent */
  --sr-paper: #111315;   /* dark background */
  --sr-surface: #181a1c;
  --sr-ink: #f2f2f2;
  --sr-muted: #a8a8a8;
  --sr-shadow: rgba(0, 0, 0, 0.4);
  --sr-edge-strong: rgba(255,255,255,0.08);

  --sr-motion-fast: 150ms;
  --sr-motion-med: 260ms;
  --sr-motion-slow: 420ms;
  --sr-easing: cubic-bezier(.22,.61,.36,1);
}

/* Global Reset & Body */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================
   Centered Layout Wrapper (NEW)
   ============================================ */
body.sr-body {
  display: flex;
  justify-content: center;        /* centers layout horizontally */
  align-items: flex-start;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(145deg, var(--sr-paper), #0e0f11);
  color: var(--sr-ink);
  overflow-x: hidden;
  line-height: 1.7;
}

.sr-layout {
  display: flex;
  flex-direction: row;
  max-width: 1400px;              /* limits total width */
  width: 100%;
  margin: 0 auto;                 /* keeps centered even on ultrawide screens */
  background: transparent;
  position: relative;
}

/* Sidebar Navigation */
.sr-sidebar {
  flex: 0 0 240px;
  height: 100vh;
  background: var(--sr-surface);
  border-right: 1px solid var(--sr-edge-strong);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 2px 0 12px var(--sr-shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sr-logo {
  margin-bottom: 40px;
}

.sr-logo-img {
  width: 140px;
  height: auto;
  filter: brightness(0.9);
}

.sr-nav ul {
  list-style: none;
  width: 100%;
  padding: 0 0;
}

.sr-nav li {
  width: 100%;
}

.sr-nav a {
  display: block;
  padding: 12px 24px;
  color: var(--sr-ink);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: background var(--sr-motion-fast) var(--sr-easing), color var(--sr-motion-fast) var(--sr-easing);
  position: relative;
}

.sr-nav a.active,
.sr-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sr-primary);
}

/* Animated link underline */
.sr-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--sr-primary), transparent);
  transition: width var(--sr-motion-med) var(--sr-easing);
}
.sr-nav a:hover::after {
  width: 100%;
}

/* Main Content */
.sr-main {
  flex: 1;
  max-width: 980px;
  padding: 60px 60px 100px;
  margin-left: 0; /* removed hard left offset */
  box-sizing: border-box;
}

/* Headings */
h1, h2, h3 {
  color: var(--sr-ink);
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--sr-edge-strong);
  padding-bottom: 6px;
  margin-top: 60px;
}

/* Paragraphs */
article p,
section p,
main p,
p {
  text-align: justify !important;
  text-justify: inter-word !important;
  -webkit-hyphens: auto !important;
  -ms-hyphens: auto !important;
  hyphens: auto !important;
  margin-bottom: 20px;
  color: var(--sr-ink);
}

/* Hero Image */
.sr-hero {
  margin: 30px 0 50px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255,255,255,0.08);
}
.sr-hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* Sections */
section.sr-section {
  position: relative;
  padding-bottom: 40px;
}
section.sr-section::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--sr-primary), transparent);
  transition: width var(--sr-motion-slow) var(--sr-easing);
}
section.sr-section.is-seen::before {
  width: 100%;
}

/* Footer */
.sr-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 60px;
  padding-top: 40px;
  text-align: center;
  position: relative;
}

.sr-footer p {
  display: inline-block;
  background: linear-gradient(180deg, #1a1c1e, #101112);
  border: 1px solid rgba(198, 106, 58, 0.4);
  border-radius: 50px;
  padding: 12px 32px;
  color: var(--sr-ink);
  font-weight: 500;
  letter-spacing: 0.3px;
  box-shadow: 0 0 12px rgba(198, 106, 58, 0.15);
  transition: transform 0.3s var(--sr-easing), box-shadow 0.3s var(--sr-easing);
}

.sr-footer p:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(198, 106, 58, 0.25);
  border-color: rgba(198, 106, 58, 0.6);
}

/* Progress Bar */
.sr-progress {
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--sr-primary), transparent);
  z-index: 9998;
  transition: width var(--sr-motion-fast) linear;
}

/* Back-to-Top (Hexagonal Shape) */
.sr-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255,255,255,0.25);
  background: linear-gradient(145deg, var(--sr-primary), #b15f32);
  color: #111;
  font: 700 18px/50px system-ui,-apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  opacity: 0 !important;
  transform: translateY(10px) !important;
  pointer-events: none !important;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
  z-index: 9999 !important;
  overflow: hidden;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  box-shadow: 0 0 12px rgba(198, 106, 58, 0.3);
}

.sr-to-top:hover {
  background: linear-gradient(145deg, #ffffff, var(--sr-primary));
}

.sr-to-top.sr-show {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.sr-to-top .ripple {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  opacity: .35;
  transform: translate(-50%,-50%) scale(0);
  background: #fff;
  animation: sr-ripple .6s ease-out forwards;
}
@keyframes sr-ripple {
  to { transform: translate(-50%,-50%) scale(8); opacity: 0; }
}

/* Subtle moving wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(120% 60% at 80% 20%, rgba(255,255,255,.05), transparent 60%),
              linear-gradient(120deg, rgba(0,0,0,.03), rgba(255,255,255,.02));
  animation: sr-wash 24s ease-in-out infinite alternate;
  opacity: .35;
}
@keyframes sr-wash {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-2%,0) scale(1.02); }
}

/* Card lift */
.sr-card {
  border: 1px solid var(--sr-edge-strong);
  border-radius: 6px;
  background: var(--sr-surface);
  padding: 20px;
  transition: transform var(--sr-motion-fast) var(--sr-easing),
              box-shadow var(--sr-motion-fast) var(--sr-easing),
              border-color var(--sr-motion-fast) var(--sr-easing);
}
.sr-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--sr-shadow);
  border-color: var(--sr-edge-strong);
}

/* Responsive Adjustments */
@media (max-width: 900px) {
  .sr-sidebar { flex: 0 0 200px; }
  .sr-main { padding: 40px 30px 80px; }
}

@media (max-width: 700px) {
  .sr-sidebar {
    position: fixed;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 20px;
    border-right: none;
    border-bottom: 1px solid var(--sr-edge-strong);
  }
  .sr-nav ul { display: flex; overflow-x: auto; }
  .sr-nav li { flex: none; }
  .sr-main {
    margin: 0;
    padding: 80px 20px;
  }
  .sr-logo { margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

