/* ==========================================================================
   Emir Kurt — Portfolio
   Minimal mono theme after the "Glitche" template language:
   white paper, fixed blue frame, Roboto Mono everywhere, glitch + typing.
   Sections: fonts / tokens / base / frame / header / footer / hero /
             portfolio page / responsive / motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts — self-hosted Roboto Mono variable (Apache 2.0, ../fonts/LICENSE.txt)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('../fonts/roboto-mono-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext: Turkish characters */
@font-face {
  font-family: 'Roboto Mono';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('../fonts/roboto-mono-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   2. Tokens (palette lifted from the Glitche reference)
   -------------------------------------------------------------------------- */
:root {
  --blue: #303F9F;
  --ink: #141414;
  --body-c: #363636;
  --muted: #999999;
  --line-c: #DDDDDD;
  --sand: #EDE574;
  --bg: #FFFFFF;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
  --frame: 30px;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body-c);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  color: var(--blue);
}

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

.u-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

/* Highlighter mark (company name in the experience line) */
.mark {
  background: var(--sand);
  color: var(--ink);
  padding: 1px 5px;
}

/* --------------------------------------------------------------------------
   4. Fixed blue frame
   -------------------------------------------------------------------------- */
.line {
  position: fixed;
  background: var(--blue);
  z-index: 110;
}

.line.top {
  left: 0;
  top: 0;
  width: 100%;
  height: var(--frame);
}

.line.bottom {
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--frame);
}

.line.left {
  left: 0;
  top: 0;
  width: var(--frame);
  height: 100%;
}

.line.right {
  right: 0;
  top: 0;
  width: var(--frame);
  height: 100%;
}

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.site-head {
  position: fixed;
  top: var(--frame);
  left: var(--frame);
  right: var(--frame);
  z-index: 100;
  background: var(--bg);
  padding: 22px 30px;
  text-align: right;
}

.site-head a {
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-left: 42px;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-foot {
  position: fixed;
  bottom: var(--frame);
  left: var(--frame);
  right: var(--frame);
  z-index: 100;
  background: var(--bg);
  padding: 16px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 11px;
  color: var(--muted);
}

.soc {
  display: flex;
  align-items: center;
  gap: 14px;
}

.soc a {
  display: inline-flex;
  color: var(--ink);
}

.soc svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.soc a:hover {
  color: var(--blue);
}

/* --------------------------------------------------------------------------
   7. Hero ("started" screen)
   -------------------------------------------------------------------------- */
.started {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: calc(var(--frame) + 80px) calc(var(--frame) + 30px);
}

.h-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 68px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.h-subtitle {
  margin: 44px 0 0;
}

.h-subtitle p {
  margin: 0;
  font-size: 13.5px;
  color: var(--body-c);
}

.h-subtitle p + p {
  margin-top: 30px;
}

.intro {
  max-width: 760px;
  margin: 34px auto 0;
  font-size: 13px;
  line-height: 2;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   8. Portfolio page sections
   -------------------------------------------------------------------------- */
.page-section {
  max-width: 900px;
  margin: 0 auto;
  /* top padding clears the fixed frame + header when a section snaps
     to the top of the viewport */
  padding: 150px calc(var(--frame) + 30px) 110px;
  min-height: 100vh;
}

/* Works runs taller than the viewport: extra bottom room so the snap
   doesn't pull the next section in before the last card is read */
#works {
  padding-bottom: 55vh;
}

.sec-title {
  display: inline-block;
  background: var(--blue);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 12px;
  margin: 0 0 36px;
}

.pill {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--blue);
  border: 1px solid var(--blue);
  padding: 3px 9px;
  white-space: nowrap;
}

.page-section p {
  margin: 0 0 18px;
  line-height: 2;
  text-wrap: pretty;
}

.page-section p:last-child {
  margin-bottom: 0;
}

/* label + value rows (about meta, stack) */
.meta-row {
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--line-c);
  padding: 12px 0;
  flex-wrap: wrap;
}

.meta-row:last-child {
  border-bottom: 1px solid var(--line-c);
}

.meta-row dt {
  flex: 0 0 150px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  padding-top: 2px;
}

.meta-row dd {
  flex: 1;
  min-width: 240px;
  margin: 0;
  color: var(--body-c);
}

.meta-list {
  margin: 28px 0 0;
}

/* Experience */
.xp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.xp-role {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.xp-org {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.xp-list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.xp-list li {
  position: relative;
  padding: 4px 0 4px 22px;
  line-height: 1.9;
  text-wrap: pretty;
}

.xp-list li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--blue);
}

.tech-line {
  font-size: 12px;
  color: var(--muted);
}

/* Works */
.work {
  border-top: 1px solid var(--line-c);
  padding: 32px 0;
}

.work:last-child {
  border-bottom: 1px solid var(--line-c);
}

.work-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.work-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.work-desc {
  margin: 0 0 14px;
  line-height: 1.9;
  text-wrap: pretty;
}

.fact {
  display: flex;
  gap: 14px;
  padding: 2px 0;
}

.fact dt {
  flex: 0 0 90px;
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  padding-top: 3px;
}

.fact dd {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--body-c);
  text-wrap: pretty;
}

.facts {
  margin: 0 0 14px;
}

/* Contact */
.page-section:last-of-type {
  padding-bottom: 170px; /* keep the last rows clear of the fixed footer */
}

.contact-links .meta-row dd a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   9. Responsive (Glitche breakpoints: 840 / 580 / 480)
   -------------------------------------------------------------------------- */
@media (max-width: 840px) {
  :root {
    --frame: 15px;
  }

  .site-head {
    padding: 16px 20px;
  }

  .site-head a {
    margin-left: 26px;
  }

  .site-foot {
    padding: 12px 20px;
  }

  .h-title {
    font-size: 52px;
  }
}

@media (max-width: 580px) {
  .h-title span {
    display: block;
  }

  .meta-row dt {
    flex-basis: 100%;
    padding-top: 0;
  }

  .fact {
    flex-wrap: wrap;
  }

  .fact dt {
    flex-basis: 100%;
  }
}

@media (max-width: 480px) {
  .h-title {
    font-size: 42px;
  }

  .foot-left {
    gap: 12px;
  }

  .copy {
    display: none;
  }
}

/* ==========================================================================
   MOTION — glitch, section snap, scroll reveals.
   To be tuned together with the user in a later session.
   ========================================================================== */
html {
  scroll-behavior: smooth;
  /* Fullpage feel: passing the halfway point snaps the viewport to the
     next section on its own — no manual aligning. Sections taller than
     the viewport still scroll freely inside (per spec). */
  scroll-snap-type: y mandatory;
}

.started,
.page-section {
  scroll-snap-align: start;
  scroll-snap-stop: always; /* one section per gesture, no fly-throughs */
}

/* Glitch: pseudo copies of the text (data-text), sliced open in short
   bursts with chromatic offsets; quiet ~90% of the time. */
.glitch-effect {
  position: relative;
  display: inline-block;
}

.glitch-effect::before,
.glitch-effect::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg);
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
}

.glitch-effect::before {
  text-shadow: -1.5px 0 #E53935;
  animation: glitch-a 3.2s infinite steps(1);
}

.glitch-effect::after {
  text-shadow: 1.5px 0 #1E88E5;
  animation: glitch-b 4.3s infinite steps(1);
}

@keyframes glitch-a {
  0%, 7%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  1% { clip-path: inset(12% 0 70% 0); transform: translateX(-3px); }
  2.5% { clip-path: inset(58% 0 20% 0); transform: translateX(2px); }
  4% { clip-path: inset(30% 0 52% 0); transform: translateX(-2px); }
  5.5% { clip-path: inset(78% 0 8% 0); transform: translateX(3px); }
}

@keyframes glitch-b {
  0%, 49%, 56%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  50% { clip-path: inset(20% 0 62% 0); transform: translateX(3px); }
  51.5% { clip-path: inset(65% 0 12% 0); transform: translateX(-2px); }
  53% { clip-path: inset(40% 0 40% 0); transform: translateX(2px); }
  54.5% { clip-path: inset(8% 0 80% 0); transform: translateX(-3px); }
}

/* Scroll-trigger reveals: .rv items are hidden only when JS is running
   (html.js) and slide in once IntersectionObserver adds .in */
html.js .rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .rv.in {
  opacity: 1;
  transform: none;
}

/* Stagger delays, assigned per section sibling order by main.js */
.rv-d1 { transition-delay: 60ms; }
.rv-d2 { transition-delay: 120ms; }
.rv-d3 { transition-delay: 180ms; }
.rv-d4 { transition-delay: 240ms; }
.rv-d5 { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  html.js .rv {
    opacity: 1;
    transform: none;
  }
}
