/* ==========================================================================
   Digital Octopus — Portfolio Stylesheet
   ========================================================================== */

/* --- Self-hosted IBM Plex Mono --- */

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('IBM_Plex_Mono/IBMPlexMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('IBM_Plex_Mono/IBMPlexMono-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('IBM_Plex_Mono/IBMPlexMono-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('IBM_Plex_Mono/IBMPlexMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Reset & Custom Properties --- */

:root {
  --bg-cream: #FDF6ED;
  --ink-black: #0D0D0D;
  --accent-mustard: #EFA93A;
  --accent-sage: #6CB081;
  --accent-terra: #E56B52;
  --accent-mint: #D6E8DC;
  --accent-sand: #EADBC8;

  --border: 3px solid var(--ink-black);
  --radius-sm: 8px;
  --radius-lg: 20px;

  --font-display: 'IBM Plex Mono', monospace;
  --font-body: 'IBM Plex Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-cream);
  color: var(--ink-black);
  font-family: var(--font-body);
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Accessibility — Focus --- */

:focus-visible {
  outline: 3px solid var(--accent-mustard);
  outline-offset: 2px;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  width: 320px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  border-right: var(--border);
  background-color: var(--bg-cream);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.brand-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 0.9;
  margin-bottom: 12px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.brand-header a {
  text-decoration: none;
  color: inherit;
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-sub::after {
  content: "";
  display: block;
  height: 3px;
  flex-grow: 1;
  background: var(--ink-black);
}

/* --- Navigation --- */

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-item a {
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 12px 0;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.nav-item a:hover,
.nav-item.active a {
  border-bottom: 3px solid var(--ink-black);
  padding-left: 8px;
}

.nav-icon {
  width: 14px;
  height: 14px;
  border: 3px solid var(--ink-black);
  border-radius: 0;
  background: transparent;
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  background: var(--ink-black);
}

/* --- Sidebar footer (decorative play icon) --- */

.sidebar-footer {
  margin-top: auto;
}

.play-button {
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink-black);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  padding: 0;
  font: inherit;
}

.play-button:hover {
  background: var(--ink-black);
}

.play-button:hover .play-icon {
  border-left-color: var(--bg-cream);
}

.play-button:hover .pause-icon span {
  background: var(--bg-cream);
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid var(--ink-black);
  display: none;
}

.pause-icon {
  display: flex;
  gap: 4px;
}

.pause-icon span {
  display: block;
  width: 4px;
  height: 14px;
  background: var(--ink-black);
}

/* When paused: show play triangle, hide pause bars */
.play-button.paused .play-icon  { display: block; }
.play-button.paused .pause-icon { display: none; }

/* --- Mobile header bar & menu toggle --- */

.mobile-bar {
  display: none;
}

.mobile-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

/* Hide the line break so it renders on one line */
.mobile-brand br {
  display: none;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink-black);
  background: var(--bg-cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--ink-black);
  transition: all 0.3s ease;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 90;
}

.sidebar-overlay.visible {
  display: block;
}

/* ==========================================================================
   Main Stage — Project Card Grid
   ========================================================================== */

.main-stage {
  margin-left: 320px;
  flex-grow: 1;
  padding: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(400px, auto);
  gap: 32px;
}

/* --- Project cards --- */

.project-card {
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  background-color: var(--bg-cream);
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 12px 12px 0px var(--ink-black);
}

/* Card colour variants */
.card-mustard { background-color: var(--accent-mustard); }
.card-sage    { background-color: var(--accent-sage); }
.card-terra   { background-color: var(--accent-terra); }
.card-cream   { background-color: var(--bg-cream); }
.card-mint    { background-color: var(--accent-mint); }
.card-sand    { background-color: var(--accent-sand); }

.card-header {
  position: relative;
  z-index: 2;
}

.card-meta {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  display: inline-block;
  border: 3px solid var(--ink-black);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.8rem;
  line-height: 0.9;
  margin-bottom: 16px;
  max-width: 90%;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.card-desc {
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 600;
  max-width: 300px;
  letter-spacing: -0.01em;
}

/* --- Action circle (arrow icon) --- */

.action-circle {
  width: 64px;
  height: 64px;
  border: 3px solid var(--ink-black);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  background: transparent;
  transition: all 0.3s ease;
  z-index: 2;
}

.action-circle svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--ink-black);
  stroke-width: 3px;
}

.project-card:hover .action-circle {
  background: var(--ink-black);
}

.project-card:hover .action-circle svg {
  stroke: var(--bg-cream);
}

/* ==========================================================================
   Geometric Decorations
   ========================================================================== */

.geo-shape {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  border: 3px solid var(--ink-black);
}

.shape-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.shape-triangle {
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 35px solid var(--ink-black);
  background: transparent;
}

.shape-line {
  width: 100px;
  height: 3px;
  background: var(--ink-black);
  transform: rotate(-45deg);
}

.wireframe-globe {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 3px solid var(--ink-black);
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
}

.wireframe-globe::before,
.wireframe-globe::after {
  content: '';
  position: absolute;
  background: var(--ink-black);
}

.wireframe-globe::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 3px;
}

.wireframe-globe::after {
  left: 50%;
  top: 0;
  width: 3px;
  height: 100%;
}

.grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--ink-black) 2px, transparent 2px),
    linear-gradient(90deg, var(--ink-black) 2px, transparent 2px);
  background-size: 40px 40px;
  opacity: 0.15;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes float {
  0%   { transform: translateY(0px) rotate(0deg); }
  50%  { transform: translateY(-20px) rotate(5deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes spin-slow {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes drift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(10px, -10px); }
  100% { transform: translate(0, 0); }
}

.anim-float { animation: float 6s ease-in-out infinite; }
.anim-spin  { animation: spin-slow 20s linear infinite; }
.anim-drift { animation: drift 8s ease-in-out infinite; }

/* ==========================================================================
   Project Detail Page
   ========================================================================== */

.project-detail {
  margin-left: 320px;
  flex-grow: 1;
  padding: 40px;
  max-width: 960px;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 40px;
  padding: 10px 20px;
  border: 3px solid var(--ink-black);
  background: transparent;
  transition: all 0.2s ease;
}

.project-back:hover {
  background: var(--ink-black);
  color: var(--bg-cream);
}

.project-back svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3px;
}

.project-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.5rem;
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.project-meta-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.project-tag {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 3px solid var(--ink-black);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.2);
}

.project-hero {
  margin-bottom: 0;
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink-black);
}

.project-hero img,
.project-hero video {
  width: 100%;
  display: block;
}

.project-description {
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 600;
  max-width: 640px;
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}

.project-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.project-info-section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--ink-black);
}

.project-info-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-info-section li {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 14px 24px;
  margin-top: 16px;
  margin-bottom: 32px;
  border: 3px solid var(--ink-black);
  background: var(--ink-black);
  color: var(--bg-cream);
  transition: all 0.2s ease;
}

.project-link:hover {
  background: transparent;
  color: var(--ink-black);
}

.project-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3px;
}

/* ==========================================================================
   Generic Page (Coming Soon)
   ========================================================================== */

.page-generic {
  margin-left: 320px;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.page-generic h1 {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.page-generic p {
  font-size: 1.2rem;
  font-weight: 600;
}

/* ==========================================================================
   Responsive — Tablet
   ========================================================================== */

@media (max-width: 1024px) {
  .sidebar { width: 240px; }

  .main-stage {
    margin-left: 240px;
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 24px;
  }

  .project-detail {
    margin-left: 240px;
    padding: 24px;
  }

  .page-generic { margin-left: 240px; }
}

/* ==========================================================================
   Responsive — Mobile
   ========================================================================== */

@media (max-width: 768px) {

  /* Fixed top bar: brand left, hamburger right */
  .mobile-bar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 68px;
    z-index: 200;
    background: var(--bg-cream);
    border-bottom: var(--border);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
  }

  /* Sidebar slides under the mobile bar */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    padding-top: 80px;
  }

  .sidebar.open { transform: translateX(0); }

  /* Content starts below the mobile bar */
  .main-stage {
    margin-left: 0;
    padding: 84px 16px 24px;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-detail {
    margin-left: 0;
    padding: 84px 16px 24px;
  }

  .page-generic {
    margin-left: 0;
    padding: 84px 16px 24px;
  }

  .project-title { font-size: 2.4rem; }
  .card-title    { font-size: 2rem; }

  .project-info-grid { grid-template-columns: 1fr; }
}
