    /* Self-hosted Outfit (latin subset, variable font: weights 300-700).
       Replaces Google Fonts CDN to avoid network font-block / text jitter on load. */
    @font-face {
      font-family: 'Outfit';
      font-style: normal;
      font-weight: 300 700;
      font-display: swap;
      src: url('../fonts/outfit-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;
    }

    /* Self-hosted Outfit (latin-ext subset, variable font: weights 300-700) for Turkish characters. */
    @font-face {
      font-family: 'Outfit';
      font-style: normal;
      font-weight: 300 700;
      font-display: swap;
      src: url('../fonts/outfit-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;
    }

    /* Theme Definitions.
       Light is the default (:root). Dark/Sepia are opt-in via [data-theme].
       A CSS-only prefers-color-scheme fallback keeps no-JS users aligned
       with their OS preference. JS (inline head script) still overrides by
       setting [data-theme] explicitly. */
    :root {
      /* Light Theme (Default) */
      --bg-color: #f9fafb;
      --accent-primary: #4f46e5;
      --accent-secondary: #7c3aed;
      --accent-glow: rgba(79, 70, 229, 0.1);
      --text-main: #111827;
      --text-muted: #4b5563;
      --input-bg: #ffffff;
      --input-border: #d1d5db;
      --input-focus: #4f46e5;
      --border-separator: #e5e7eb;
      --success: #10b981;
      --error: #ef4444;
    }

    [data-theme="dark"] {
      --bg-color: #0b0f19;
      --accent-primary: #6366f1;
      --accent-secondary: #a855f7;
      --accent-glow: rgba(99, 102, 241, 0.15);
      --text-main: #f3f4f6;
      --text-muted: #9ca3af;
      --input-bg: #1f2937;
      --input-border: #374151;
      --input-focus: #6366f1;
      --border-separator: #1f2937;
      --success: #10b981;
      --error: #ef4444;
    }

    [data-theme="sepia"] {
      --bg-color: #f4ecd8;
      --accent-primary: #a0522d;
      --accent-secondary: #8b4513;
      --accent-glow: rgba(160, 82, 45, 0.1);
      --text-main: #433422;
      --text-muted: #705e4c;
      --input-bg: #fdfaf2;
      --input-border: #dcd0b4;
      --input-focus: #a0522d;
      --border-separator: #e3d5b8;
    }

    /* No-JS / pre-script fallback: respect OS preference when no data-theme is set. */
    @media (prefers-color-scheme: dark) {
      :root:not([data-theme]) {
        --bg-color: #0b0f19;
        --accent-primary: #6366f1;
        --accent-secondary: #a855f7;
        --accent-glow: rgba(99, 102, 241, 0.15);
        --text-main: #f3f4f6;
        --text-muted: #9ca3af;
        --input-bg: #1f2937;
        --input-border: #374151;
        --input-focus: #6366f1;
        --border-separator: #1f2937;
      }
    }

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

    body {
      font-family: 'Outfit', sans-serif;
      background-color: var(--bg-color);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 3rem 1.5rem;
      transition: background-color 0.3s ease, color 0.3s ease;
    }

    .container {
      width: 100%;
      max-width: 1100px;
      margin: 0 auto;
    }

    /* Main Grid Layout (Default: Stacked Profile Top, Form Bottom) */
    .layout-grid {
      display: grid;
      grid-template-columns: 1fr;
      max-width: 900px;
      margin: 0 auto;
      gap: 3rem;
    }

    /* Flat container structure - no borders, backgrounds, or shadows */
    .profile-card,
    .form-card {
      background-color: transparent !important;
      border: none !important;
      box-shadow: none !important;
      padding: 0 !important;
      border-radius: 0 !important;
    }

    /* Default (Stacked) Profile Card Grid Layout */
    .layout-grid .profile-card {
      display: grid;
      grid-template-columns: 6.2fr 3.8fr;
      gap: 2.5rem;
      align-items: flex-start;
      /* Top align both text and image */
      border-bottom: 1px solid var(--border-separator);
      padding-bottom: 3rem !important;
      transition: border-color 0.3s ease;
    }

    .layout-grid .profile-card .cv-download-wrapper {
      grid-column: 1;
      grid-row: 1;
      margin-top: 0;
      margin-bottom: 1.5rem;
      border-top: none;
      border-bottom: 1px solid var(--border-separator);
      padding-top: 0;
      padding-bottom: 1.5rem;
    }

    .layout-grid .profile-card .profile-text {
      grid-column: 1;
      grid-row: 2;
    }

    .layout-grid .profile-card .avatar-wrapper {
      grid-column: 2;
      grid-row: 2;
      position: relative;
      width: 100%;
      margin-bottom: 0;
    }

    .avatar {
      width: 100%;
      height: auto;
      max-height: 350px;
      object-fit: cover;
      border-radius: 12px;
      display: block;
    }

    /* Layout Modifier: Sidebar Left */
    .layout-grid.layout-sidebar-left {
      grid-template-columns: 4.5fr 5.5fr;
      max-width: 1100px;
      gap: 3.5rem;
    }

    .layout-grid.layout-sidebar-left footer {
      grid-column: span 2;
    }

    .layout-grid.layout-sidebar-left .profile-card {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      border-right: 1px solid var(--border-separator);
      padding-right: 3.5rem !important;
      border-bottom: none;
      padding-bottom: 0 !important;
      gap: 0;
    }

    .layout-grid.layout-sidebar-left .profile-card .profile-text {
      order: 2;
    }

    .layout-grid.layout-sidebar-left .profile-card .avatar-wrapper {
      order: 1;
      margin-bottom: 1.5rem;
    }

    .layout-grid.layout-sidebar-left .profile-card .cv-download-wrapper {
      order: 0;
      margin-top: 0;
      margin-bottom: 1.5rem;
      border-top: none;
      border-bottom: 1px solid var(--border-separator);
      padding-top: 0;
      padding-bottom: 1.5rem;
    }

    /* Layout Modifier: Sidebar Right */
    .layout-grid.layout-sidebar-right {
      grid-template-columns: 5.5fr 4.5fr;
      max-width: 1100px;
      gap: 3.5rem;
    }

    .layout-grid.layout-sidebar-right footer {
      grid-column: span 2;
    }

    .layout-grid.layout-sidebar-right .profile-card {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      border-left: 1px solid var(--border-separator);
      padding-left: 3.5rem !important;
      border-right: none;
      padding-right: 0 !important;
      border-bottom: none;
      padding-bottom: 0 !important;
      gap: 0;
      grid-column: 2;
      grid-row: 1;
    }

    .layout-grid.layout-sidebar-right .form-card {
      grid-column: 1;
      grid-row: 1;
    }

    .layout-grid.layout-sidebar-right .profile-card .profile-text {
      order: 2;
    }

    .layout-grid.layout-sidebar-right .profile-card .avatar-wrapper {
      order: 1;
      margin-bottom: 1.5rem;
    }

    .layout-grid.layout-sidebar-right .profile-card .cv-download-wrapper {
      order: 0;
      margin-top: 0;
      margin-bottom: 1.5rem;
      border-top: none;
      border-bottom: 1px solid var(--border-separator);
      padding-top: 0;
      padding-bottom: 1.5rem;
    }

    /* Layout Modifier: Form Only */
    .layout-grid.layout-form-only {
      grid-template-columns: 1fr;
      max-width: 900px;
      margin: 0 auto;
    }

    .layout-grid.layout-form-only .profile-card {
      display: none;
    }

    /* Profile details content styles */
    .title-area {
      margin-bottom: 1.5rem;
    }

    .title-area h1 {
      font-size: 2rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      line-height: 1.2;
    }

    .title-area .tagline {
      font-size: 1.05rem;
      color: var(--accent-primary);
      font-weight: 500;
      margin-top: 0.25rem;
    }

    .bio-section {
      font-size: 1rem;
      line-height: 1.6;
      color: var(--text-muted);
      margin-bottom: 1.5rem;
    }

    .bio-section p {
      margin-bottom: 1rem;
    }

    .skills-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
    }

    .skill-badge {
      font-size: 0.8rem;
      padding: 0.3rem 0.75rem;
      background-color: var(--input-bg);
      border: 1px solid var(--input-border);
      border-radius: 6px;
      color: var(--text-main);
      font-weight: 500;
      transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .contact-details {
      width: 100%;
      padding-top: 1.25rem;
      border-top: 1px solid var(--border-separator);
    }

    .detail-item {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 0.85rem;
      font-size: 0.95rem;
      color: var(--text-muted);
    }

    .detail-item a {
      color: var(--text-main);
      text-decoration: none;
      border-bottom: 1px dashed var(--accent-primary);
      transition: color 0.2s ease;
    }

    .detail-item a:hover {
      color: var(--accent-primary);
    }

    .btn-cv {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      padding: 0.8rem 1.5rem;
      background-color: var(--input-bg);
      border: 1px solid var(--input-border);
      border-radius: 10px;
      color: var(--text-main);
      text-decoration: none;
      font-weight: 600;
      font-size: 0.95rem;
      transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .btn-cv:hover {
      background-color: var(--input-border);
      border-color: var(--accent-primary);
    }

    /* Form Container */
    .form-header {
      margin-bottom: 2rem;
    }

    .form-header h2 {
      font-size: 1.6rem;
      font-weight: 600;
      color: var(--text-main);
    }

    .form-header p {
      color: var(--text-muted);
      font-size: 0.95rem;
      margin-top: 0.25rem;
    }

    /* Form Input elements */
    .form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.25rem;
    }

    .full-width {
      grid-column: span 2;
    }

    .field-group {
      display: flex;
      flex-direction: column;
    }

    label {
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-main);
      margin-bottom: 0.4rem;
      display: flex;
      justify-content: space-between;
    }

    label span.optional {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-weight: 400;
    }

    input,
    select,
    textarea {
      width: 100%;
      padding: 0.8rem 0.95rem;
      background-color: var(--input-bg);
      border: 1px solid var(--input-border);
      border-radius: 10px;
      color: var(--text-main);
      font-family: inherit;
      font-size: 0.95rem;
      outline: none;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
    }

    textarea {
      resize: vertical;
      min-height: 110px;
    }

    input:focus,
    select:focus,
    textarea:focus {
      border-color: var(--input-focus);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }

    select {
      appearance: none;
      -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.85rem center;
      background-size: 1.1rem;
      padding-right: 2.25rem;
      cursor: pointer;
    }

    /* Submit Button styling */
    .btn-container {
      margin-top: 1.75rem;
    }

    button[type="submit"] {
      width: 100%;
      padding: 0.95rem 2rem;
      background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
      border: none;
      border-radius: 10px;
      color: white;
      font-family: inherit;
      font-size: 0.95rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 0.5rem;
      box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
      transition: transform 0.1s ease, box-shadow 0.2s ease;
    }

    button[type="submit"]:hover {
      box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    }

    button[type="submit"]:active {
      transform: translateY(1px);
    }

    button[type="submit"]:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    /* Spinner Animation */
    .spinner {
      width: 18px;
      height: 18px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      border-top-color: white;
      animation: spin 0.8s linear infinite;
      display: none;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    /* Toast Notification styles */
    .status-toast {
      padding: 0.85rem 1rem;
      border-radius: 10px;
      margin-bottom: 1.25rem;
      font-size: 0.9rem;
      display: none;
    }

    .status-toast.visible {
      display: block;
    }

    .status-toast.success-style {
      background-color: rgba(16, 185, 129, 0.1);
      border: 1px solid rgba(16, 185, 129, 0.2);
      color: #34d399;
    }

    .status-toast.error-style {
      background-color: rgba(239, 68, 68, 0.1);
      border: 1px solid rgba(239, 68, 68, 0.2);
      color: #fca5a5;
    }

    /* Footer styling */
    footer {
      grid-column: span 1;
      text-align: center;
      margin-top: 3.5rem;
      color: var(--text-muted);
      font-size: 0.85rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-top: 1px solid var(--border-separator);
      padding-top: 2rem;
    }

    .footer-control-group {
      display: flex;
      gap: 1.5rem;
      align-items: center;
    }

    .control-item {
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .control-item label {
      font-size: 0.85rem;
      color: var(--text-muted);
      margin-bottom: 0;
    }

    .layout-selector-wrapper {
      display: flex;
      align-items: center;
    }

    footer select {
      width: auto !important;
      padding: 0.35rem 2rem 0.35rem 0.6rem !important;
      font-size: 0.85rem !important;
      border-radius: 6px !important;
      height: auto !important;
      background-position: right 0.6rem center !important;
      background-size: 0.9rem !important;
      border: 1px solid var(--input-border) !important;
    }

    @media (max-width: 900px) {

      .layout-grid,
      .layout-grid.layout-sidebar-left,
      .layout-grid.layout-sidebar-right,
      .layout-grid.layout-form-only {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        max-width: 100%;
      }

      .layout-grid .profile-card,
      .layout-grid.layout-sidebar-left .profile-card,
      .layout-grid.layout-sidebar-right .profile-card {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        border-right: none !important;
        border-left: none !important;
        border-bottom: 1px solid var(--border-separator) !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
        padding-bottom: 2.5rem !important;
        gap: 1.5rem !important;
      }

      .layout-grid.layout-sidebar-right .profile-card,
      .layout-grid.layout-sidebar-right .form-card {
        grid-column: auto;
        grid-row: auto;
      }

      .layout-grid .profile-card .avatar-wrapper,
      .layout-grid.layout-sidebar-left .profile-card .avatar-wrapper,
      .layout-grid.layout-sidebar-right .profile-card .avatar-wrapper {
        grid-column: auto !important;
        order: 1 !important;
        margin-bottom: 1rem !important;
      }

      .layout-grid .profile-card .profile-text,
      .layout-grid.layout-sidebar-left .profile-card .profile-text,
      .layout-grid.layout-sidebar-right .profile-card .profile-text {
        grid-column: auto !important;
        order: 3 !important;
      }

      /* Stacked layout: show photo under the contact details in mobile */
      .layout-grid:not(.layout-sidebar-left):not(.layout-sidebar-right):not(.layout-form-only) .profile-card .avatar-wrapper {
        order: 4 !important;
        margin-top: 1.5rem !important;
      }

      .layout-grid .profile-card .cv-download-wrapper,
      .layout-grid.layout-sidebar-left .profile-card .cv-download-wrapper,
      .layout-grid.layout-sidebar-right .profile-card .cv-download-wrapper {
        grid-column: auto !important;
        order: 2 !important;
        margin-top: 0 !important;
        margin-bottom: 1.5rem !important;
        border-top: none !important;
        border-bottom: 1px solid var(--border-separator) !important;
        padding-top: 0 !important;
        padding-bottom: 1.5rem !important;
      }

      footer,
      .layout-grid.layout-sidebar-left footer,
      .layout-grid.layout-sidebar-right footer {
        grid-column: span 1 !important;
        flex-direction: column;
        gap: 1.5rem;
      }

      .footer-control-group {
        flex-direction: column;
        gap: 1rem;
      }
    }

    .lang-link {
      color: var(--accent-primary);
      text-decoration: none;
      font-weight: 500;
    }

    .lang-link:hover {
      text-decoration: underline;
    }

    /* Page-specific styles for the problem -> solution -> work -> contact arc. */
    .hero-problem {
      text-align: center;
      max-width: 820px;
      margin: 1rem auto 0;
      padding: 2rem 0 1rem;
    }

    .hero-statement {
      font-size: clamp(1.6rem, 4.5vw, 2.6rem);
      font-weight: 700;
      line-height: 1.25;
      color: var(--text-main);
      margin: 0 auto;
    }

    .section-label {
      text-align: center;
      font-size: clamp(1.6rem, 4.5vw, 2.6rem);
      font-weight: 700;
      line-height: 1.25;
      color: var(--text-main);
      margin: 2.5rem auto 0;
    }

    .solution-intro {
      max-width: 760px;
      margin: 0 auto;
      text-align: center;
    }

    .solution-intro .title-area {
      margin-bottom: 1rem;
    }

    .solution-intro .title-area h1 {
      font-size: clamp(1.8rem, 4vw, 2.4rem);
    }

    .solution-intro .bio-section {
      text-align: left;
    }

    .solution-intro .bio-proof {
      color: var(--accent-primary);
      font-weight: 600;
      margin-bottom: 1rem;
    }

    .solution-intro .skills-grid {
      justify-content: center;
    }

    .solution-intro .contact-details {
      border-top: none;
      padding-top: 0;
    }

    .solution-intro .profile-text {
      grid-column: auto;
    }

    .solution-intro .intro-header {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1.25rem;
      margin-bottom: 1.5rem;
    }

    .solution-intro .avatar-wrapper {
      width: 96px;
      flex: 0 0 96px;
      margin: 0;
    }

    .solution-intro .avatar-wrapper .avatar {
      border-radius: 12px;
      max-height: 96px;
    }

    /* Intro reveal: fades in sequentially right after the hero arrow */
    .js .intro-reveal {
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
    }

    .intro-reveal.show {
      opacity: 1;
      transform: translateY(0);
    }

    /* Scroll reveal */
    .js .reveal {
      opacity: 0;
      transform: translateY(24px);
      transition: opacity 0.6s ease, transform 0.6s ease;
    }

    /* Sequence: hero -> profile (0.5s) -> form (1s) -> work (1.5s), so nothing appears out of order. */
    .form-card.reveal { transition-delay: 1s; }
    .section-label.reveal { transition-delay: 1.5s; }
    .work-card.reveal { transition-delay: 1.5s; }

    .reveal.show {
      opacity: 1;
      transform: translateY(0);
    }

    /* Selected work grid */
    .work-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 1.5rem;
      margin: 2rem auto 0;
      max-width: 1000px;
      width: 100%;
    }

    @media (max-width: 600px) {
      .work-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
      }

      .work-thumb {
        height: 180px;
      }
    }

    .work-card {
      background-color: var(--input-bg);
      border: 1px solid var(--input-border);
      border-radius: 12px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: border-color 0.2s ease, transform 0.2s ease;
    }

    .work-card:hover {
      border-color: var(--accent-primary);
      transform: translateY(-3px);
    }

    /* Imagined "your project here" card */
    .work-card-next {
      border: 2px dashed var(--accent-primary);
      background: transparent;
    }

    .work-next-thumb {
      width: 100%;
      height: 160px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-bottom: 1px solid var(--input-border);
      background:
        repeating-linear-gradient(45deg,
          var(--border-separator) 0, var(--border-separator) 1px,
          transparent 1px, transparent 12px);
    }

    .work-next-plus {
      font-size: 3rem;
      font-weight: 700;
      color: var(--accent-primary);
      line-height: 1;
    }

    .work-card-next .work-body a {
      color: var(--accent-secondary);
    }

    .work-thumb {
      width: 100%;
      height: 160px;
      object-fit: cover;
      object-position: top center;
      display: block;
      border-bottom: 1px solid var(--input-border);
    }

    .work-body {
      padding: 1.1rem 1.2rem 1.2rem;
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
    }

    .work-body h3 {
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--text-main);
      margin-bottom: 0.5rem;
    }

    .work-body p {
      font-size: 0.9rem;
      line-height: 1.55;
      color: var(--text-muted);
      margin-bottom: 0.9rem;
    }

    .work-body a {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--accent-primary);
      text-decoration: none;
      margin-top: auto;
    }

    .work-body a:hover {
      text-decoration: underline;
    }

    @media (prefers-reduced-motion: reduce) {
      .reveal,
      .intro-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
      }
    }
